django.core.exceptions.ImproperlyConfigured: Requested setting AUTHENTICATION_BACKENDS, but settings are not configured


django.core.exceptions.ImproperlyConfigured: Requested setting AUTHENTICATION_BACKENDS, but settings are not configured. You mu
st either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

 需要使用到Django 的数据库,Django数据库需要使用的话必须先到settings 里设置

把manage.py 里面的

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projectname.settings")

这一句放在自定义的manage.py里面

 

posted on 2018-03-06 15:42  urnotnemo  阅读(164)  评论(0编辑  收藏  举报

导航