Metadata-Version: 2.4
Name: django-sysconfig
Version: 1.0.1
Summary: Schema-driven, database-backed runtime configuration app for Django
Project-URL: Homepage, https://github.com/krishnamodepalli/django-sysconfig
Project-URL: Repository, https://github.com/krishnamodepalli/django-sysconfig
Project-URL: Issues, https://github.com/krishnamodepalli/django-sysconfig/issues
Project-URL: Documentation, https://krishnamodepalli.github.io/django-sysconfig/
Project-URL: Changelog, https://github.com/krishnamodepalli/django-sysconfig/blob/master/CHANGELOG.md
Author: Krishna Modepalli
License: MIT
License-File: LICENSE
Keywords: admin,configuration,django,settings
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.11
Requires-Dist: cryptography>=41.0
Requires-Dist: django>=4.2
Provides-Extra: dev
Requires-Dist: black>=24.0; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest-django>=4.8; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# django-sysconfig

[![PyPI version](https://img.shields.io/pypi/v/django-sysconfig?label=PyPI&color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/django-sysconfig/)
[![Python versions](https://img.shields.io/pypi/pyversions/django-sysconfig)](https://pypi.org/project/django-sysconfig/)
[![CI](https://github.com/krishnamodepalli/django-sysconfig/actions/workflows/ci.yml/badge.svg)](https://github.com/krishnamodepalli/django-sysconfig/actions/workflows/ci.yml)
[![License](https://img.shields.io/github/license/krishnamodepalli/django-sysconfig)](https://github.com/krishnamodepalli/django-sysconfig/blob/master/LICENSE)

**Schema-driven, database-backed runtime configuration for Django.**

Define typed config fields in code. Store values in the database. Edit everything live through a built-in admin UI — without touching `settings.py`.

![django-sysconfig demo](https://github.com/krishnamodepalli/django-sysconfig/releases/download/v0.3.0/django-sysconfig.gif)

---

## Install

```bash
pip install django-sysconfig
```

```python
# settings.py
INSTALLED_APPS = [
    "django_sysconfig",   # add at the top
    ...
]
```

```bash
python manage.py migrate
```

---

## Quick example

```python
# 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)])
```

```python
# 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 toggle `maintenance_mode` at `/admin/config/` — no code change, no redeploy.

---

## Documentation

Full guides, API reference, and examples are in the docs.

- [Quick Start](https://krishnamodepalli.github.io/django-sysconfig/quickstart/) — up and running in 5 minutes
- [Installation](https://krishnamodepalli.github.io/django-sysconfig/installation/) — full setup guide

---

## Contributing

See [CONTRIBUTING.md](https://github.com/krishnamodepalli/django-sysconfig/blob/develop/CONTRIBUTING.md). Issues and pull requests are welcome.

---

## Security

Please do not open a public issue for security vulnerabilities. Report them privately via [GitHub Security Advisories](https://github.com/krishnamodepalli/django-sysconfig/security/advisories/new).
