Opened 4 years ago

Closed 4 years ago

#16628 closed New feature (duplicate)

Provide a class to hold application-based settings

Reported by: AzMoo Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When developing a portable application it would be useful to have a simple way to access the project settings first and fall back to an application-based settings module for defaults.

Application developers can create a settings.py module in the application and instantiate settings using the ApplicationSettingsHolder.

Example:

__init__.py:

from django.conf import ApplicationSettingsHolder

settings = ApplicationSettingsHolder('myapp.settings')

access settings with:

from myapp import settings

Attachments (1)

application-settings-holder.diff (1.1 KB) - added by AzMoo 4 years ago.
Replacement patch that is properly formatted.

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by AzMoo

Replacement patch that is properly formatted.

comment:1 Changed 4 years ago by russellm

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

I'm going to mark this a duplicate of #3591, which is a much more comprehensive approach to the configuration of applications.

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