Django DEBUG = False 引起的问题 django - Setting DEBUG = False causes 500 Error

把settings.py中的DEBUG设置为False前端页面显示不正常了

DEBUG = False
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['*']

Django 1.5 introduced the allowed hosts setting that is required for security reasons. A settings file created with Django 1.5 has this new section which you need to add:

# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []

Add your host here like ['www.beta800.net'] or ['*'] for a quick test, but don't use ['*'] for production.



阅读更多
个人分类: django
上一篇如何改变nginx显示静态目录文件的文件名长度
下一篇django + uwsgi 配置
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭