#8703: Development server fails to load settings
---------------------------------------+------------------------------------
 Reporter:  benspaulding               |       Owner:  nobody    
   Status:  new                        |   Milestone:            
Component:  django-admin.py runserver  |     Version:  SVN       
 Keywords:                             |       Stage:  Unreviewed
Has_patch:  0                          |  
---------------------------------------+------------------------------------
 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.
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8703>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to