Opened 13 years ago

Closed 13 years ago

#824 closed enhancement (invalid)

Need change the Environment variable DJANGO_SETTINGS_MODULE check

Reported by: limodou@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


If I want to import some django module in IDLE to do some testing work, but I may get follows execption:

import django.core.formfields

Traceback (most recent call last):

File "<pyshell#0>", line 1, in -toplevel-

import django.core.formfields

File "c:\python24\lib\site-packages\django-0.90-py2.4.egg\django\core\", line 1, in -toplevel-

from django.core import validators

File "c:\python24\lib\site-packages\django-0.90-py2.4.egg\django\core\", line 28, in -toplevel-

from django.conf.settings import JING_PATH

File "c:\python24\lib\site-packages\django-0.90-py2.4.egg\django\conf\", line 29, in -toplevel-

raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE

EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.

Can you change the checking to DJANGO_SETTINGS_MODULE? I think if there is no DJANGO_SETTINGS_MODULE Environment variable or command line argument, the django should use current path as the value of DJANGO_SETTINGS_MODULE or omit it at all. That should be better. And I also can import some django module in IDLE without exception.

Change History (1)

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

If you set DJANGO_SETTINGS_MODULE before you run IDLE, I believe this will solve your problem.

Note: See TracTickets for help on using tickets.
Back to Top