django-configurations

Organize Django project settings with composable, class-based configuration and typed environment values.

Library
PyPI
v2.5.1
1,135stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
46/100Fair
Development Activity0
Maintenance20
Community76
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture80
Code Quality78
Innovation74
Learning Curve78

django-configurations eases Django project configuration by relying on the composability of Python classes. It extends Django’s module-based settings loading with well-established object-oriented programming patterns, so your settings live on a class and different environments become subclasses that inherit and override one another.

Instead of tangled conditionals and scattered if DEBUG branches, you define a Configuration class hierarchy and pull environment-specific values from typed Value descriptors backed by environment variables. This makes settings DRY, discoverable, and easy to reason about across development, staging, and production.

What You Get

  • A Configuration base class that replaces flat settings modules
  • Environment-specific settings via class inheritance and overrides
  • Typed Value descriptors that read and coerce environment variables
  • setup_value and post_setup hooks for computed and deferred settings
  • Drop-in integration with Django’s manage.py, WSGI, and ASGI entrypoints
  • Support across multiple Python and Django versions

Common Use Cases

  • Separating development, staging, and production Django settings cleanly
  • Reading typed configuration (bools, ints, database URLs) from environment variables
  • Sharing common settings across environments without duplication
  • Computing derived settings from other values with post-setup hooks
  • Following twelve-factor configuration practices in Django apps

Under The Hood

Architecture — django-configurations replaces Django’s flat, module-level settings with a Configuration base class. Settings become class attributes, and environments are expressed as subclasses that inherit and override each other, giving you a Base/Dev/Prod hierarchy instead of conditional branches. A small importer hooks into Django’s settings loading (activated via DJANGO_CONFIGURATION and a patched manage.py/wsgi.py entrypoint) so Django reads attributes off the selected class. Value descriptor classes pull typed values from environment variables, with setup_value and post_setup hooks for computed and deferred settings.

Tech Stack — Pure Python with Django as its only real dependency, packaged via setuptools (setup.py/setup.cfg) and tested across a matrix of Python and Django versions through tox. Documentation is hosted on Read the Docs.

Code Quality — A focused codebase in the configurations/ package with a dedicated tests/ suite and a test_project/ for integration coverage, run under CI with codecov reporting. The project is mature and stable but currently sees low recent activity, typical of a settled Jazzband-maintained utility.

API Design — The API leans on familiar OOP: define a class, add attributes, subclass per environment, and wrap env-driven values in typed Value objects (BooleanValue, IntegerValue, DatabaseURLValue, etc.). This keeps configuration DRY and discoverable, though it requires the one-time setup of swapping in the library’s entrypoint helpers.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search