#13612: manage.py imports settings.py even when --settings is used
-------------------------------------+-------------------------------------
               Reporter:  tonnzor    |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Milestone:  1.4        |      Component:  Core (Management
                Version:  SVN        |  commands)
             Resolution:             |       Severity:  Normal
           Triage Stage:  Accepted   |       Keywords:
    Needs documentation:  0          |      Has patch:  1
Patch needs improvement:  0          |    Needs tests:  0
                                     |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by graham_king):

 * needs_better_patch:  1 => 0
 * easy:   => 0
 * milestone:  1.3 => 1.4


Comment:

 If settings.py is not found, instead of issuing a warning message asking
 the user to run django-admin, couldn't we just do it for them? Only issue
 the error if that doesn't work.

 The attached patch tries {{{management.execute_from_command_line()}}}
 before it issues the warning message.

 That seems to make manage.py work for the three cases:
  - settings.py in current directory
  - settings on command line as --settings (and settings.py in current
 directory is optional)
  - settings in env variable DJANGO_SETTINGS_MODULE (and settings.py in
 current directory is optional)

 A disadvantage is that if no settings.py is present in the current
 directory, and the settings file used throws an !ImportError, the actual
 error is obscured by the warning message. However that message asks you to
 try django-admin.py, which does correctly display the error.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/13612#comment:6>
Django <https://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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to