关闭

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

1216人阅读 评论(0) 收藏 举报
分类:

把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.



0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:1301635次
    • 积分:13180
    • 等级:
    • 排名:第1039名
    • 原创:37篇
    • 转载:762篇
    • 译文:0篇
    • 评论:18条
    最新评论