from django.conf import settings
def my_view(self, request, *args, **kwargs):
if 'LOCAL' in settings and settings.LOCAL:
# do something
TypeError at … argument of type
‘LazySettings’ is not iterable
How then to check if a setting exists? Otherwise I get an attribute error.
You can use the
hasattrfunction: