{"id":21199,"library":"edx-django-release-util","title":"edx-django-release-util","description":"A Django utility library for Open edX to manage release-specific operations, such as feature gating, version comparison, and release cookie handling. Version 1.5.0 is the latest; maintained by the Open edX community.","status":"active","version":"1.5.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/edx-django-release-util","tags":["openedx","django","release","feature-gating"],"install":[{"cmd":"pip install edx-django-release-util","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Correct import path for the middleware.","wrong":"","symbol":"release_cookie_middleware","correct":"from edx_django_release_util.middleware import ReleaseCookieMiddleware"},{"note":"Import the feature_gating module for checking feature flags.","wrong":"","symbol":"feature_gating_utils","correct":"from edx_django_release_util import feature_gating"},{"note":"Import the version module for comparing versions.","wrong":"","symbol":"version_utils","correct":"from edx_django_release_util import version"}],"quickstart":{"code":"import os\nfrom django.http import HttpResponse\nfrom edx_django_release_util import version, feature_gating\n\n# Example: check if a feature is gated\nfeature_name = 'my_new_feature'\nif feature_gating.is_feature_enabled(feature_name):\n    response = HttpResponse('Feature enabled')\nelse:\n    response = HttpResponse('Feature disabled')\n\n# Example: compare versions\ncurrent_version = '1.0.0'\nminimum_version = '1.0.1'\nif version.is_release_version_gt(minimum_version, current_version):\n    print('Upgrade required.')\n","lang":"python","description":"Quickstart: check feature gating and compare versions."},"warnings":[{"fix":"Add 'edx_django_release_util.middleware.ReleaseCookieMiddleware' to MIDDLEWARE in settings.py.","message":"The `is_feature_enabled` function requires a properly configured release cookie middleware. Ensure `ReleaseCookieMiddleware` is added to `MIDDLEWARE` in Django settings.","severity":"gotcha","affected_versions":"all"},{"fix":"Always use strict semver format: MAJOR.MINOR.PATCH.","message":"Version comparison functions expect semantic versioning (e.g., '1.0.0'). Non-standard version strings may cause errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use explicit module imports as shown in the imports section.","message":"The old import path `from edx_django_release_util import ...` works for top-level submodules, but import from explicit modules (e.g., `edx_django_release_util.version`) is clearer.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `pip install edx-django-release-util` in the correct environment.","cause":"Library not installed or virtual environment not activated.","error":"ModuleNotFoundError: No module named 'edx_django_release_util'"},{"fix":"Use `from edx_django_release_util import feature_gating` instead of `import edx_django_release_util`.","cause":"Importing the top-level package instead of the submodule.","error":"AttributeError: module 'edx_django_release_util' has no attribute 'feature_gating'"},{"fix":"Ensure version strings follow strict semver (e.g., '1.0.0').","cause":"Non-standard version format passed to version comparison functions.","error":"ValueError: Invalid version string: '1.0.0a'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}