django-config-models
Purpose
This app allows other apps to easily define a configuration model that can be hooked into the admin site to allow configuration management with auditing.
Getting Started
Add config_models to your INSTALLED_APPS list.
Usage
Create a subclass of ConfigurationModel, with fields for each value that needs to be configured:
from django.db import models
from config_models.models import ConfigurationModel
class MyConfiguration(ConfigurationModel):
frobble_timeout = models.IntegerField(default=10)
frazzle_target = models.TextField(default="debug")
This is a normal django model, so it must be synced and migrated as usual.
The default values for the fields in the ConfigurationModel will be used if no configuration has yet been created.
Register that class with the Admin site, using the ConfigurationAdminModel:
from django.contrib import admin
from config_models.admin import ConfigurationModelAdmin
admin.site.register(MyConfiguration, ConfigurationModelAdmin)
Use the configuration in your code:
def my_view(self, request):
config = MyConfiguration.current()
fire_the_missiles(config.frazzle_target, timeout=config.frobble_timeout)
Use the admin site to add new configuration entries. The most recently created entry is considered to be current.
Configuration
The current ConfigurationModel will be cached in the configuration django cache, or in the default cache if configuration doesn’t exist. The configuration and default caches are specified in the django CACHES setting. The caching can be per-process, per-machine, per-cluster, or some other strategy, depending on the cache configuration.
You can specify the cache timeout in each ConfigurationModel by setting the cache_timeout property.
You can change the name of the cache key used by the ConfigurationModel by overriding the cache_key_name function.
Extension
ConfigurationModels are just django models, so they can be extended with new fields and migrated as usual. Newly added fields must have default values and should be nullable, so that rollbacks to old versions of configuration work correctly.
Documentation
The full documentation is at https://django-config-models.readthedocs.org.
License
The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.
Please see LICENSE.txt for details.
Getting Help
If you’re having trouble, we have discussion forums at discuss.openedx.org where you can connect with others in the community.
Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace.
For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you are facing as you can provide.
For more information about these options, see the Getting Help page.
How To Contribute
Contributions are very welcome.
Please read How To Contribute for details.
This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to have a discussion about your new feature idea with the maintainers prior to beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.
Open edX Code of Conduct
All community members are expected to follow the Open edX Code of Conduct.
People
The assigned maintainers for this component and other project details may be found in Backstage. Backstage pulls this data from the catalog-info.yaml file in this repo.
Reporting Security Issues
Please do not report security issues in public. Please email security@openedx.org.
Metadata
Release files for django-config-models 3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_config_models-3.1.0.tar.gz | 39.4 kB | With provenance | Details for django_config_models-3.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_config_models-3.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_config_models-3.1.0-py3-none-any.whl |
Total release size: 68.1 kB
Release files / django_config_models-3.1.0.tar.gz
| Download URL | django_config_models-3.1.0.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e3f53765b79309f0b96fba16bc8c4c4f9bd0de2161ae844dbd018b0e62d2da5
|
|
BLAKE2b-256 checksum How to use checksums |
6a1cfb8775ef6b80d44a83e39a6bd966018aa7f0cd64efa34895694ef0ac415b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / django_config_models-3.1.0-py3-none-any.whl
| Download URL | django_config_models-3.1.0-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c738fa28d13e22c6fb569183b7b365cb70c0df4b24d4b10c22d54428b2bc1732
|
|
BLAKE2b-256 checksum How to use checksums |
02c58789c3285082a18b8c52107145f6b15045e43f1dc7734b03349d358772bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logSecurity for django-config-models 3.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for django_config_models-3.1.0.tar.gz
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 Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.