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.

 

pycharm 里运行 django 工程 You must either define the environment variable DJANGO_SETTINGS_MODULE 错误..._第1张图片

 

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

 PYTHONUNBUFFERED=1;DJANGO_SETTINGS_MODULE=xxxx.settings

 

pycharm 里运行 django 工程 You must either define the environment variable DJANGO_SETTINGS_MODULE 错误..._第2张图片

 

转载于:https://www.cnblogs.com/yaks/p/11281521.html

你可能感兴趣的:(python,开发工具,测试)