Django

Code

Ticket #8246 (closed: fixed)

Opened 4 months ago

Last modified 4 months ago

Subpackage Settings Fix

Reported by: AdamG Assigned to: russellm
Milestone: 1.0 Component: django-admin.py
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

r8282 introduces a regression by adding a line like so:

setup_environ(__import__(settings.SETTINGS_MODULE)) 

I don't know why this line is used, but since __import__ returns the first package, even in a dotted expression like settings.development, this line has the net effect of running setup_environ on settings.__init__ instead of settings.development, which has, as you can imagine, negative effects - like breaking runserver (since it can't find any settings), and any management command that spawn a subprocess (which captures the new, incorrect DJANGO_SETTINGS_MODULE environment variable).

The attached patch fixes this.

(I'm guessing on the assignee, forgive me if I'm wrong.)

Attachments

fix_subpackage_settings.patch (1.0 kB) - added by AdamG on 08/11/08 19:04:46.
A patch to fix this issue.

Change History

08/11/08 19:04:46 changed by AdamG

  • attachment fix_subpackage_settings.patch added.

A patch to fix this issue.

08/11/08 20:13:12 changed by brosner

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

08/11/08 20:13:20 changed by brosner

  • milestone set to 1.0.

08/12/08 08:39:46 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(In [8323]) Fixed #8246 -- Corrected the handling of settings files. Thanks to AdamG and chrj for their parallel reports and fixes.


Add/Change #8246 (Subpackage Settings Fix)




Change Properties
Action