skillfed

django-flags

Feature flags for Django projects

django-flags v5.2.0 309.1K downloads/30d#7,760 on PyPI298
Permissive license CC0-1.0 Active released

What it is and what it does

Django-Flags is a feature flag system that lets you control feature availability in Django applications without redeploying code. You define flags in Django settings or the admin interface and toggle them based on conditions—date ranges, specific users, URL parameters, or custom logic—to stage rollouts, run A/B tests, or gate experimental features.

The package integrates directly into Django's template system and Python code, so you can wrap features in conditional blocks that check flag state at runtime. Flags are editable through Django's admin interface, making it possible for non-developers to manage feature availability. It requires Python 3.10+ and Django 4.2+, and has no additional runtime dependencies beyond Django itself.

Use it for:

  • Stage feature rollouts gradually to users by enabling a flag for a percentage of traffic or specific user groups.
  • Run A/B tests by toggling different code paths for different user segments based on flag conditions.
  • Disable problematic features in production without redeploying by flipping a flag in the admin interface.
  • Test new functionality in production with a small set of users before full release.
  • Manage time-limited features or promotions that activate on specific dates.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Django-Flags provides a feature flag system for Django projects, allowing you to toggle functionality on and off in code and templates based on configurable conditions like dates, users, or URL values.

Yes. Django-Flags is actively maintained, has no security vulnerabilities, minimal install friction, and solves a common need in Django projects. The permissive CC0-1.0 license removes any legal friction. Install it if you need runtime control over feature availability without redeployment.

Install

django-flags on PyPI

pip

pip install django-flags

uv

uv add django-flags

poetry

poetry add django-flags

Installing django-flags

Before you install

Low install friction: pure Python wheel with only Django as a runtime dependency. Active maintenance with a recent release (185 days ago) and ongoing commits; supports current Python versions (3.10–3.13) and modern Django versions (4.2–6.0).

License in practice

Licensed under CC0-1.0 (public domain equivalent), which is permissive and imposes no restrictions on use, modification, or redistribution in your own projects.

Quickstart

pip install django-flags

# In settings.py, add to INSTALLED_APPS:
INSTALLED_APPS = [
    ...
    'flags',
]

# In your view or template:
from flags.conditions import flag_enabled

if flag_enabled('my_feature'):
    # Feature code here
    pass

Requires Django 4.2+ and Python 3.10+; you must add 'flags' to INSTALLED_APPS for the app to function.

Package facts

License CC0-1.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — django
Maintenance actively maintained — 185 days since the last release
Last repo commit
First released
Downloads 309,132/month — #7,760 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_flags-5.2.0-py3-none-any.whl

Framework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

django feature flagsfeature toggle djangoconditional feature deploymentdjango a/b testingdjango feature managementruntime feature controldjango admin feature flags
feature-flagsdjango-middlewarea-b-testing

More Application Frameworks packages