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

 
posted @ 2015-08-14 21:01  圆旭  阅读(3926)  评论(0编辑  收藏  举报