Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#5049 closed (wontfix)

[PATCH] Application settings import

Reported by: Joshua 'jag' Ginsberg <jag@…> Owned by: adrian
Component: Core (Other) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


We develop lots of utility applications that include many customizable configuration settings. Installing them all and modifying to include all of the settings makes our complex and unwieldly. Thus we felt that these application-specific settings should be pushed out to files in each specific application so that the defaults are always defined, and to allow each project/site to override these application defaults by creating <app_name>.py in a project subfolder called app_settings.

This is best described with an example. My project in this example is skwx and my app is cienfuegos.

$ ./ shell
Python 2.4.3 (#2, Oct  6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir('/srv/skwx')
['', '', '', '', 'svn', 'cienfuegos', '__init__.pyc', 'django.db', 'app_settings', '', 'settings.pyc']
>>> os.listdir('/srv/skwx/cienfuegos')
['', '', '', '__init__.pyc', '', '', '', 'models.pyc', '', '', 'settings.pyc']
>>> os.listdir('/srv/skwx/app_settings')
['', '', '__init__.pyc', 'cienfuegos.pyc']
>>> print open('/srv/skwx/cienfuegos/').read()
>>> print open('/srv/skwx/app_settings/').read()
FOO='not bar'
>>> from django.conf import settings
>>> settings.cienfuegos.FOO
'not bar'
>>> settings.cienfuegos.WTF

Please let me know if you feel this could be appropriate for inclusion. Thanks!


Attachments (1)

django-settings.patch (3.3 KB) - added by Joshua 'jag' Ginsberg <jag@…> 8 years ago.
Patch to django/conf/

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Joshua 'jag' Ginsberg <jag@…>

Patch to django/conf/

comment:1 Changed 8 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

As noted in the mailing list; this idea has come up in the past (search the archives) and we've decided against it.

comment:2 Changed 6 years ago by ericholscher

Refs #1371

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