django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment varia

Use this

import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

instead of

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<appname>.settings")

Leave a Comment

techhipbettruvabetnorabahisbahis forumu