所有的错误统一都返回 "in exception"
比如我在 views.py 里随便乱写一行也是返回 in exception
正常例子: def test(request): ret = {'test':1} return HttpResponse(json.dumps(ret), content_type="application/json")
返回 in exception 例子: def test(request): asdfasdb #乱写的错误 ret = {'test':1} return HttpResponse(json.dumps(ret), content_type="application/json")
我的 django 版本
import django django.VERSION (2, 0, 2, 'final', 0)
debug 也是开的 DEBUG = True
麻烦各位大佬了,今天冒了两次泡哈哈
2 条回复 • 2018-05-09 17:46:48 +08:00
|
1
fankcoder OP 哇 ,代码格式瞎了。。。
正常例子: def test(request): ret = {'test':1} return HttpResponse(json.dumps(ret), content_type="application/json") 返回 in exception 例子: def test(request): asdfasdb #乱写的错误 ret = {'test':1} return HttpResponse(json.dumps(ret), content_type="application/json") |
|
2
fankcoder OP 返回 in exception 例子:
def test(request): asdfasdb #乱写的错误 ret = {'test':1} return HttpResponse(json.dumps(ret), content_type="application/json") |
推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide