Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pydev autogen DJANGO_SETTINGS_MODULE environment variable?

I am using Eclipse 3.7.2 and Pydev 2.6 to develop Django program. When I upgrade my Django from 1.3 to 1.4.1, I find a question about "DJANGO_SETTINGS_MODULE" environment variable. When I run manage.py in console, "DJANGO_SETTINGS_MODULE" is None first, and via

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

will get value correctly.

But when I run code in PyDev, the environment is be set "folder_name.settings" before program. Even if in non Django program. And I can't find any way to change the value.

How can I set the value outside my program?

Thanks.

like image 553
Eric Chen Avatar asked Nov 03 '22 17:11

Eric Chen


1 Answers

The appropriate value for DJANGO_SETTINGS_MODULE can be set through the Eclipse UI:

Right click on the project folder in the explorer window

Select Properties

Select the PyDev - Django properties page. You will see a place to enter the correct setting. If this is blank, PyDev appears to choose a "reasonable" default.

like image 119
Dan Menes Avatar answered Nov 09 '22 19:11

Dan Menes