python代码中使用settings

在具体的Django应用中,通过引入 django.conf.settings 使用配置,例:
from django.conf import settings

settings.configure(DEBUG=True, TEMPLATE_DEBUG=True,
    TEMPLATE_DIRS=('/home/web-apps/myapp', '/home/web-apps/base'))

转自:http://django-chinese-docs-14.readthedocs.org/en/latest/topics/settings.html

 
原文地址:https://www.cnblogs.com/pinganzi/p/4731207.html