A django app to help you manage the django-shopify-app package billing
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_feature_flags-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b8d01c1d2917660fa30ad2174b1b4eac907d11705d2b0e10f1a5e23e3184709 |
|
MD5 | fc26b4935fc907cca7a95a161823fc9a |
|
BLAKE2b-256 | 28454c416c3fe9b9fb9c7c6a6f40ea1f61ff6af2d8b05cecab9ac0e7e3701830 |
Close
Hashes for django_feature_flags-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8275d06b41140665e4dddbe77b34f55f4f4047bb5d2761d0b64640b713ddf45 |
|
MD5 | 90cb81da04ffa98a7f81c7372f7f4233 |
|
BLAKE2b-256 | c2c4034ae0385b3432dd6ff9213c9a732e858269372b65ceee4e44e427aba41b |