﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8703	Development server fails to load settings	Ben Spaulding	nobody	"Using {{{django-admin.py runserver}}} fails to load the settings if:

 1. the settings module is three or more levels deep, and
 2. you rely on {{{DJANGO_SETTINGS_MODULE}}}

=== Examples ===

I don’t know how to patch the problem, but this is the testing I did to see what all was affected.

==== Failures ====

Directory structure: 

{{{
          django
        /
~/sites
        \
          mysite---foo---settings.py
}}}
 
Command line:

{{{
$ cd ~/sites
$ PYTHONPATH=pwd
$ DJANGO_SETTINGS_MODULE=mysite.foo.settings
$ django-admin.py runserver
Error: Could not import settings 'foo.settings' (Is it on sys.path? Does it have syntax errors?): No module named foo.settings
}}}
 
Directory structure: 

{{{
          django
        /
~/sites
        \
          mysite---foo---bar---settings.py
}}}
 
Command line:

{{{
$ DJANGO_SETTINGS_MODULE=mysite.foo.bar.settings
$ django-admin.py runserver
Error: Could not import settings 'bar.settings' (Is it on sys.path? Does it have syntax errors?): No module named bar.settings
}}}

==== Success ====

I found no failure with {{{manage.py}}}. {{{django-admin.py}}} succeeded as long as the settings module was not nested more than two deep or was set explicity with the {{{--settings}}} option.

Directory structure: 

{{{
            django
          /
~/sites---
          \
            mysite---settings.py
}}}

Command line:

{{{
$ DJANGO_SETTINGS_MODULE=mysite.settings
$ django-admin.py runserver
Validating models...
0 errors found

Django version 1.0-beta_2-SVN-8645, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
}}}

Directory structure: 

{{{
            django
          /
~/sites---
          \
            mysite---foo---settings.py
}}}

Command line:

{{{
$ django-admin.py runserver --settings=mysite.foo.settings
Validating models...
0 errors found

Django version 1.0-beta_2-SVN-8645, using settings 'mysite.foo.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
}}}

"		closed	django-admin.py runserver	dev		fixed			Accepted	0	0	0	0	0	0
