Alex Rivera | Logout

PyCharm: DJANGO_SETTINGS_MODULE is undefined

Asked 2011-05-13T07:23:23.620
21

I am using PyCharm IDE and when I run any file.py I get this error:

..raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

How to configure DJANGO_SETTINGS_MODULE environment variable in PyCharm?

Edit
Report

2 Answers

9

You can go to the tool bar which shows a dropdown and select your project ->edit configuration. There in the Environment variable area enter DJANGO_SETTINGS_MODULE mysite.settings and save .

answered 2011-08-22T17:13:32.053
8
answered 2011-05-13T07:25:32.090

Your Answer