pycharm 里运行 django 工程 You must either define the environment variable DJANGO_SETTINGS_MODULE 错误

 

pycharm 里运行 django 工程出现错误(在命令行直接运行ok):

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

 

 

在Enviroment variables里添加如下信息(xxx 为你的项目名):

 PYTHONUNBUFFERED=1;DJANGO_SETTINGS_MODULE=xxxx.settings

 

 

posted @ 2019-08-01 11:39  yaks  阅读(7459)  评论(0编辑  收藏  举报