定义项目目录常量 import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 随机秘钥 # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '=X…
配置python+mod_wsgi+apache 时 在浏览器中访问服务器时报错:Invalid HTTP_HOST header: 'XXXXX'. You may need to add u'XXXXX' to ALLOWED_HOSTS,在setting.py中添加ALLOWED_HOSTS['*"]无效的原因:是apache没有配置ServerName localhost:80 .配置完成后,解决了以上的问题 故障表现的现象是:使用localhost 访问apache是ok的,单无法使…