Skip to main content

This app helps to add feature flags to your django app

Installation

pip install django-feature-flags

Usage

Add feature_flags to your INSTALLED_APPS in settings.py

INSTALLED_APPS = [
    ...
    'feature_flags',
    ...
]

Add your feature flags and feature flag groups in your settings.py

FEATURE_FLAGS = {
    'feature1': {
        'description': 'This is a feature flag',
    },
    'feature2': {
        'description': 'This is a feature flag',
    },
    'feature3': {
        'description': 'This is a feature flag',
    },
}

FEATURE_FLAG_GROUPS = {
    'group1': ['feature1', 'feature2'],
    'group2': ['feature3'],
}
FEATURE_FLAG_DEFAULT_GROUP = 'group1'

Add the feature flag group to your tenant model

from feature_flags.utils import get_feature_flags_by_group_name

class Tenant(models.Model):
    ...
    feature_flags_group = models.CharField(
        max_length=255,
        choices=FEATURE_FLAG_GROUPS.items(),
        default=FEATURE_FLAG_DEFAULT_GROUP,
    )
    ...

    @property
    def feature_flags(self):
        return get_feature_flags_by_group_name(self.feature_flags_group)

Metadata

Release files for django-feature-flags 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-feature-flags 0.0.3
File Size Uploaded Provenance Actions
django_feature_flags-0.0.3.tar.gz 2.9 kB Without provenance Details for django_feature_flags-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-feature-flags 0.0.3
File Interpreter ABI Platform Actions
django_feature_flags-0.0.3-py3-none-any.whl Python 3 none any Details for django_feature_flags-0.0.3-py3-none-any.whl

Total release size: 8.1 kB

Release files / django_feature_flags-0.0.3.tar.gz

Download URL django_feature_flags-0.0.3.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
608fe77660a04bacc4c4ec61b21fea52cf8e2c2a18037a12647a92a9cf753573
BLAKE2b-256 checksum
How to use checksums
016ee75fb13118bb38a2683aae8fd2fe50800ec7640e08facfcd0140161182ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / django_feature_flags-0.0.3-py3-none-any.whl

Download URL django_feature_flags-0.0.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c56ee8cb60f20d94de0f064cdf45ce9bd5a074105fc46450de4c32bccb1bd8f
BLAKE2b-256 checksum
How to use checksums
08d9c9fce4e9ba124386083f366bbfe28e6b4c31310223429527342bd21991d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Security for django-feature-flags 0.0.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page