{"id":21142,"library":"django-config-models","title":"django-config-models","description":"A Django library providing configuration models with auditing capabilities, enabling management of dynamic site configuration through database-backed models. Version 3.0.0 is the latest, actively maintained by the Open edX community. Releases are irregular but stable.","status":"active","version":"3.0.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/django-config-models","tags":["django","configuration","audit","models","openedx"],"install":[{"cmd":"pip install django-config-models","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required framework.","package":"Django","optional":false},{"reason":"Provides base utilities.","package":"edx-django-utils","optional":false}],"imports":[{"note":"Old name before migration to config_models.","wrong":"from configuration_models.models import ConfigurationModel","symbol":"ConfigurationModel","correct":"from config_models.models import ConfigurationModel"}],"quickstart":{"code":"from config_models.models import ConfigurationModel\nfrom django.db import models\n\nclass MyConfig(ConfigurationModel):\n    key = models.CharField(max_length=255, unique=True)\n    value = models.TextField()\n\n# Usage\nconfig = MyConfig.current()\nprint(config.value)","lang":"python","description":"Define a configuration model by subclassing ConfigurationModel and access current active config via .current()."},"warnings":[{"fix":"Upgrade Django to 4.2 or later.","message":"In v3.0.0, Django 3.2 support dropped; requires Django >=4.2.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Change import to 'from config_models.models import ConfigurationModel'.","message":"Old import path 'configuration_models' is deprecated; use 'config_models'.","severity":"deprecated","affected_versions":"<3.0.0"},{"fix":"Use bulk operations or update only when necessary.","message":"ConfigurationModel uses an audit log; every save creates a new historical record. Avoid calling .save() in loops.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'config_models' instead: from config_models.models import ConfigurationModel","cause":"Deprecated import path.","error":"ModuleNotFoundError: No module named 'configuration_models'"},{"fix":"Ensure Django is fully set up before importing config models. In scripts, use django.setup() after configuring settings.","cause":"Django settings not loaded before using models.","error":"django.core.exceptions.ImproperlyConfigured: Requested setting, but settings are not configured."},{"fix":"Ensure only one record has enabled=True for each unique key or use .current() which handles conflicts.","cause":"More than one active configuration record exists (e.g., multiple enabled=True).","error":"config_models.models.ConfigurationModel.MultipleObjectsReturned: get() returned more than one ConfigurationModel -- it returned 2!"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}