Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#6546 closed (wontfix)

Add option to load settings from installed apps

Reported by: jezdez Owned by: jezdez
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: UI/UX:


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 jezdez 8 years ago.
App settings, first try

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by jezdez

App settings, first try

comment:1 Changed 8 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to jezdez
  • Patch needs improvement unset

comment:2 Changed 8 years ago by guettli

  • Resolution set to wontfix
  • Status changed from new to closed

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 8 years ago by jezdez

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 8 years ago by jezdez

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

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