Reputation: 20438
My settings file has:
DEBUG = True
The obvious method:
if DEBUG:
print 'debug'
Does not seem to work:
global name 'DEBUG' is not defined
Upvotes: 16
Views: 9911
Reputation: 10146
As mentioned in the comment, you need to do:
from django.conf import settings
print(settings.DEBUG)
Upvotes: 39