Skip to main content

django-settings2

A simple Django app to store and retrieve application settings in the database.

Requirements

  • Python >= 3.6
  • Django >= 3.2

Installation

pip install django-settings2

Configuration

Add to INSTALLED_APPS

INSTALLED_APPS = [
    ...
    "django_settings2",
]

Run migrations

python manage.py migrate

Usage

from django_settings2.models import DjangoSettings

# Store a value
DjangoSettings.set_value("my_key", "hello")
DjangoSettings.set_value("max_retries", 5, cls=int)
DjangoSettings.set_value("threshold", 0.75, cls=float)

# Retrieve a value
value = DjangoSettings.get_value("my_key", default="fallback")

# Retrieve a JSON value stored as text
data = DjangoSettings.get_value_json("my_json_key", default={})

# Retrieve with row-level lock (useful in transactions)
data = DjangoSettings.get_value_json("my_json_key", lock=True)

License

MIT

Metadata

Release files for django-settings2 1.0.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-settings2 1.0.0
File Size Uploaded Provenance Actions
django_settings2-1.0.0.tar.gz 3.9 kB Without provenance Details for django_settings2-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-settings2 1.0.0
File Interpreter ABI Platform Actions
django_settings2-1.0.0-py3-none-any.whl Python 3 none any Details for django_settings2-1.0.0-py3-none-any.whl

Total release size: 9.5 kB

Release files / django_settings2-1.0.0.tar.gz

Download URL django_settings2-1.0.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
10ef98342f22ee66a5efb9adc4885a10d0193794705d912ea4c19d2610d3d2ff
BLAKE2b-256 checksum
How to use checksums
0df52259d965b793ddfe2a0aa2da1d35435c3caf456b9ab60ef57d25e628bb6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.17

Release files / django_settings2-1.0.0-py3-none-any.whl

Download URL django_settings2-1.0.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59bb746fd3c57d4fb1e3aaa10cc1b555a565c0067d0cb034621513887e6d9e69
BLAKE2b-256 checksum
How to use checksums
c69679a670c3125464d7461b30d43b242a05f04422244b0d821a7274b7f9ff52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.17

Security for django-settings2 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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