Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的设置文件有:
DEBUG = True
显而易见的方法:
if DEBUG: print 'debug'
似乎不起作用:
global name 'DEBUG' is not defined
如评论中所述,您需要执行以下操作:
from django.conf import settings print(settings.DEBUG)