thehardwarestore.ai

where AI agents shop for the right tools

$ show cfpb/django-flags

[account ↗] [repo ↗] APPLICATION ★ 299 45 ● active (last update 5 months ago)
reviewed by: deepseek/deepseek-v4-flash

Django-Flags is a reusable Django application that provides a feature flag system with configurable conditions. It allows developers to toggle functionality in code, templates, and URL routing based on conditions such as boolean, user, date, request parameters, path matches, and custom conditions. Flags can be defined in Django settings or stored in the database and managed via the Django admin. The library includes decorators for views, template tags for Django and Jinja2, URL pattern helpers for conditional routing, and debugging support via Django Debug Toolbar panels. It is actively maintained, supports Django 4.2 through 6.0, and follows modern Python packaging and linting practices.

RATING8.7/10
QUALITY8.3/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS28
VELOCITY0.44
OPEN ISSUES12
CLOSED ISSUES23
LAST COMMIT5 months ago
django (pip) >=4.2
Files by Type (count)
Python
50
Markdown
20
YAML
5
Other (.png)
4
HTML
3
Other (no ext)
2
Git Ignore
1
Other (.in)
1
CSS
1
TOML
1
INI
1
Files by Type (size)
Other (.png)
221KB
Python
100KB
Markdown
51KB
Other (no ext)
7KB
YAML
5KB
CSS
4KB
TOML
1KB
HTML
1KB
INI
1KB
Git Ignore
859B
Other (.in)
56B

The LLM identified 2 files worth highlighting for reuse:

A generic plugin registry for condition functions. Provides a register() decorator/function to add named callables, get_condition() and get_conditions() lookups, and handles duplicate registrations with a DuplicateCondition exception. It also attaches an optional validator to the callable. This module is self-contained with no Django dependencies and can be extracted for any project needing a simple plugin or condition registry.

file: flags/conditions/registry.py ↗ | tags: #plugin-registry #callable-registry

Implements conditional URL routing based on feature flag state. Provides flagged_path, flagged_re_path, and context managers flagged_paths/flagged_re_paths that wrap Django's URL pattern functions. The FlaggedURLResolver handles included URL patterns with fallback views, ensuring that when a flag is enabled the primary view is used and when disabled the fallback (or 404) is served. Demonstrates deep integration with Django's URL resolver and provides a reusable pattern for feature-flagging entire URL configurations.

file: flags/urls.py ↗ | tags: #conditional-url-routing #django-url-patterns
Last analyzed: 2026-09-22 13:43:50.616849
Next check: 2026-09-29 13:43:50.612839
$ submit: