标签: django
我的设置文件包含:
DEBUG = True
显而易见的方法:
if DEBUG: print 'debug'
似乎不起作用:
global name 'DEBUG' is not defined
答案 0 :(得分:3)
如评论中所述,您需要这样做:
from django.conf import settings print settings.DEBUG