Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.0.2 instead.
Reason given by maintainers: Bug

Logo

License: MIT Ruff pyrefly PyPI PyPI pyversions PyPI djversions PyPI status PyPI - Downloads PyPI - Types


Tests Codecov pre-commit.ci status


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.
  • Full cache snapshotget_value() never falls back to a single-row ORM read.
  • Stock Django Admin — edit values with standard ModelAdmin and 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

https://django-gc.rdd-lab.com/

Download files

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

Source Distribution

django_gc-1.0.1.tar.gz (29.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_gc-1.0.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file django_gc-1.0.1.tar.gz.

File metadata

  • Download URL: django_gc-1.0.1.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for django_gc-1.0.1.tar.gz
Algorithm Hash digest
SHA256 72b20dbab4c6d0ae45ae91fa5e17f198e742c7fe153aec2ddf39e8880530dd3a
MD5 9f4e96bce7d0570bffc859885d6f9f72
BLAKE2b-256 49e318006444ece6bc47d63d29d4d3cee55f52e788e1baa9325b294e9ff053d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_gc-1.0.1.tar.gz:

Publisher: publish.yml on RDDLab/Django-GC

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_gc-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_gc-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for django_gc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fc37e4cb666930a67fd0e066e0aa674bd6549562e261b12cd0d86c71641f0ce
MD5 64c5114d56953f5046e9f353dafe7258
BLAKE2b-256 a8eece48a6bd1b1eb9b21d511eee2540a1b9ba6e234a54732ddcdadc6aa5af43

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_gc-1.0.1-py3-none-any.whl:

Publisher: publish.yml on RDDLab/Django-GC

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

Release history Release notifications | RSS feed

1.0.2

2 files

This release

1.0.1 This release

2 files

Supported by

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