Skip to main content

A Magento-style system configuration app for Django

Project description

django-sysconfig

PyPI version Python versions CI Release License Demo

Runtime configuration for Django. Define typed config fields in code, store values in the database, edit everything through a built-in admin UI — without touching settings.py.


Why django-sysconfig?

Some settings belong in settings.py. Others — feature flags, rate limits, API keys, email addresses — need to change at runtime without a redeploy, often by someone who isn't an engineer.

django-sysconfig gives those settings a proper home: a typed schema in code, values in the database, and a clean staff UI to manage them.


Install

pip install django-sysconfig
# settings.py
INSTALLED_APPS = [
    "django_sysconfig",   # add at the top
    ...
]
python manage.py migrate

Quick example

# myapp/sysconfig.py
from django_sysconfig.registry import register_config, Section, Field
from django_sysconfig.frontend_models import BooleanFrontendModel, IntegerFrontendModel
from django_sysconfig.validators import RangeValidator

@register_config("myapp")
class MyAppConfig:
    class General(Section):
        label = "General"

        maintenance_mode = Field(BooleanFrontendModel, label="Maintenance Mode", default=False)
        max_items = Field(IntegerFrontendModel, label="Max Items", default=100,
                          validators=[RangeValidator(min_value=1, max_value=10_000)])
# anywhere in your project
from django_sysconfig.accessor import config

if config.get("myapp.general.maintenance_mode"):
    return HttpResponse("Down for maintenance.", status=503)

Staff can change maintenance_mode through /admin/config/ — no code change, no redeploy.


What's included

  • 7 field types — string, integer, decimal, boolean, select, textarea, encrypted secret
  • 20 built-in validators — email, URL, IP, hostname, port, range, regex, slug, JSON, and more
  • Auto-discovery — drop a sysconfig.py in any installed app, it's picked up on startup
  • Typed accessorconfig.get(...) always returns the correct Python type
  • Caching — values are cached via Django's cache framework, invalidated on every write
  • Encryption at rest — secret fields use Fernet symmetric encryption
  • on_save callbacks — react to value changes with custom logic
  • Management commandsconfig get, config set, config import, config export

Requirements

Minimum
Python 3.11
Django 4.2
cryptography 41.0

Documentation

krishnamodepalli.github.io/django-sysconfig


Contributing

See CONTRIBUTING.md. Issues and pull requests are welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_sysconfig-1.0.0.tar.gz (47.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sysconfig-1.0.0-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file django_sysconfig-1.0.0.tar.gz.

File metadata

  • Download URL: django_sysconfig-1.0.0.tar.gz
  • Upload date:
  • Size: 47.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_sysconfig-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cda832653ece8f85c3137710619ede15048e4908c7d9d0717dd5051ee96c236f
MD5 dd1d770237ff38b6cb4ae8773fb91093
BLAKE2b-256 25a6b0cfb151ed68c229a5745461e4c63545007f218375768fbbcc3d551f7df7

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sysconfig-1.0.0.tar.gz:

Publisher: release.yml on krishnamodepalli/django-sysconfig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_sysconfig-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sysconfig-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b7515fbf9789420011a686003e6b4d56626f2f0ecc48e4e733dbd6aa4d5cd2e
MD5 46e4fa27467ed438b15c1b496d99a829
BLAKE2b-256 ea627e57919dfce7d4b8f3a42225fb504e77fc19efa07229a3b33af44446debe

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sysconfig-1.0.0-py3-none-any.whl:

Publisher: release.yml on krishnamodepalli/django-sysconfig

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page