Django运行报错:django.core.exceptions.ImproperlyConfigured

Django运行报错

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

发现pycharm 右上角选择运行的文件错误,应该选择dj项目

修改成

 

再次运行就不会报错了

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章