Documentation: https://django-gc.rdd-lab.com/
Source Code: https://github.com/RDDLab/Django-GC
Django-GC
Django-GC stores typed runtime settings in the database and serves them from Django's cache. Application code never reads a value through the ORM. The project owns the keys; this package is the mechanism.
Features
- Code-declared keys — categories and definitions live in Django settings and are synchronized after migrate.
- Typed values — strings, numbers, dates, arrays, choices, JSON, UUID, and optional secure secrets.
- Targeted cache updates — saving one setting refreshes only its typed cache entry.
- Full recovery snapshot —
get_value()never falls back to a single-row ORM read on cache miss. - Stock Django Admin — edit values with standard
ModelAdminand Django's built-in change history. - Optional Celery — periodic full snapshot refresh.
- Fully typed — ships
py.typed; compatible with pyrefly and standard type checkers.
Installation
pip install django-gc
INSTALLED_APPS = [
'django_gc',
'django.contrib.admin',
# ...
]
Periodic refresh is optional:
pip install 'django-gc[celery]'
Quick start
In Django settings, set categories, keys, and the encryption key. Then migrate and read values through the service:
from enum import StrEnum
from django_gc import (
CategoryDefinition,
SettingDefinition,
SettingType,
get_value,
set_value,
)
class SettingKey(StrEnum):
MAINTENANCE_ENABLED = 'maintenance-enabled'
GLOBAL_CONFIG_CATEGORIES = [
CategoryDefinition(id=1, code='platform', name='Platform'),
]
GLOBAL_CONFIG_DEFINITIONS = [
SettingDefinition(
key=SettingKey.MAINTENANCE_ENABLED,
description='Maintenance mode',
default_value=False,
value_type=SettingType.BOOLEAN,
category_id=1,
),
]
GLOBAL_CONFIG_ENCRYPTION_KEY = 'replace-with-a-long-random-secret'
enabled = get_value(SettingKey.MAINTENANCE_ENABLED)
set_value(SettingKey.MAINTENANCE_ENABLED, True)
Documentation
Metadata
Release files for django-gc 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_gc-1.1.4.tar.gz | 32.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_gc-1.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.2 kB
Release files / django_gc-1.1.4.tar.gz
| Download URL | django_gc-1.1.4.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05e130d1a0b1e1fc2e922f7d4569b8c38cc1392d719c56033c7bb497ef142c2d
|
|
BLAKE2b-256 checksum How to use checksums |
bb00060fda87f99d2ae3ca2f62818a2f7cf74a2460c9846478d5e57fe97d15f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / django_gc-1.1.4-py3-none-any.whl
| Download URL | django_gc-1.1.4-py3-none-any.whl |
|---|---|
| Size | 34.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
407b530638b730fcb6202e5be5ca63b8362bb711ad34fcf5cfde34c06d744ceb
|
|
BLAKE2b-256 checksum How to use checksums |
5e0c85a21094c6d67c54cbdfde4eaa77b3b8efea619cb68f219cd6a954389acf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log