Skip to main content

django-extended-settings

Apps for Django to extend global settings with additional files

Initialize other configuration settings for django project Other configurations must be set in /path/to/project/djangoproject/settings.d/*_settings.py

    Project/
    |_ apps1/
    |_ ...
    |_ project/
       |_ settings.py
       |_ urls.py
       |_ ...
       |_ settings.d/
          |_ one_settings.py
          |_ second_settings.py

The current version of the Django Extended Settings is 1.3.1. It works on Django ≥ 5.0.

Installation

Getting the code

The recommended way to install the Django Extended Settings is via pip or pipenv:

$ pip install django-extended-settings

Prerequisites

Make sure add extended_settings to your INSTALLED_APPS setting:

INSTALLED_APPS = [
    # ...
    'extended_settings',
    # ...
]

Play settings into your project

Create sub directory settings.d/ into django project directory and put your configuration into independant files with this patterns *_settings.py

sample : /path/to/project/djangopython/settings.d/production_settings.py

Play database settings

You can add some settings in database

$ ./manage.py migrate

In your python files, you can create settings (in command for example) like this

from extended_settings.models import ExtentedSettings

o = ExtentedSettings()
o.name = "My home page location"
o.key = "hostname"
o.value = "http://localhost:8000"
o.save()

better alternative,

from extended_settings.models import ExtentedSettings

ExtentedSettings.set(
    key="hostname",
    value="http://localhost:8000",
    name="My home page location",
)

ExtentedSettings.set_data(
    key="data",
    value=["Aron Run", "toto marche", "mistal:online", -3.14, True, False, {"val": 2}],
    name="My list",
)

To retrieve settings in your views, ...

from extended_settings.models import ExtentedSettings

my_var = ExtentedSettings.get("hostname")
my_var = ExtentedSettings.get("hostname", 'default value')

my_int = ExtentedSettings.get_int("my-int")
my_float = ExtentedSettings.get_float("my-float", 100.0)
my_bool = ExtentedSettings.get_boolean("my-bool") # True = yes, y, true, 1, ...

my_list = ExtentedSettings.get_data("data")
>>> ['Aron marcel', 'toto marche', 'mistral:online', -3.14, True, False, {"val": 2}]

Misc

The Django Extended Settings is released under the BSD license, like Django itself. If you like it, please consider contributing!

The Django Extended Settings was originally created by Mickael Badet in September 2018.

Special thanks to contributer JunkyDeveloper for Django ≥ 5.0, Python 3.12 fix.

Metadata

Release files for django-extended-settings 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-extended-settings 1.4.0
File Size Uploaded Provenance Actions
django_extended_settings-1.4.0.tar.gz 7.9 kB Without provenance Details for django_extended_settings-1.4.0.tar.gz

Release files / django_extended_settings-1.4.0.tar.gz

Download URL django_extended_settings-1.4.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
deac626c390976dc68758c048fa61d273f935184d1d14713b3b92039befd3c5f
BLAKE2b-256 checksum
How to use checksums
d1bdf210ecdc3cbaa6b5fbecb560ecc7fcf66db5e2da629d8d3d78be190504b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.5

Security for django-extended-settings 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page