Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6546 closed (wontfix)

Add option to load settings from installed apps

Reported by: Jannis Leidel Owned by: Jannis Leidel
Component: Core (Other) Version: master
Severity: Keywords: settings reusable apps
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


It might be useful for reusable apps to automatically load settings from installed apps.

The attached patch enables app authors to put a file in their app distributions.
These app settings are automatically loaded (except if there is already a setting with the same name) and can be overridden by project settings.

Attachments (1)

app_settings_jannis.1.diff (1.2 KB) - added by Jannis Leidel 11 years ago.
App settings, first try

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Jannis Leidel

Attachment: app_settings_jannis.1.diff added

App settings, first try

comment:1 Changed 11 years ago by Jannis Leidel

Owner: changed from nobody to Jannis Leidel

comment:2 Changed 11 years ago by Thomas Güttler

Resolution: wontfix
Status: newclosed

Sorry, but I think this is a bad idea. For what kind of settings do you want to
use this application specific settings file?

It would be better to have a common place to store application specific settings somewhere

I store them in settings.APPNAME. Example: settings.APPNAME.default_color='green'.

The app specific settings get loaded like this:

import APPNAME

comment:3 Changed 11 years ago by Jannis Leidel

Yeah, this is what I use in my Django "projects" to have local settings, pretty basic of course:

    from local_settings import *
except ImportError:

I figured it might be good to have app-based settings as defaults that can be overridden by other users if required and wrote this snippet: Which is ugly.

But since the INSTALLED_APPS and app loading mechanism is redesigned anyway, the new App objects might be the right place for having these default settings. What do you think?

comment:4 Changed 11 years ago by Jannis Leidel

Ah, here is what was discussed during the Pycon sprint: InstalledAppsRevision

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