In my views.py I have
from django.conf import settings
def site_view(request):
...
if some_var == settings.MY_SETTING:
...
The value MY_SETTING is defined in settings.py. However I get the following error when I try and load the view:
Exception Type: AttributeError
Exception Value: 'function' object has no attribute 'MY_SETTING'
What’s going on?
How about importing settings like:
then: