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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 608fe77660a04bacc4c4ec61b21fea52cf8e2c2a18037a12647a92a9cf753573 |
|
MD5 | af1766e3621623836b78796587f434f4 |
|
BLAKE2b-256 | 016ee75fb13118bb38a2683aae8fd2fe50800ec7640e08facfcd0140161182ac |
Close
Hashes for django_feature_flags-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c56ee8cb60f20d94de0f064cdf45ce9bd5a074105fc46450de4c32bccb1bd8f |
|
MD5 | 4f6250f3c8d65a2cd27d5e4f0fae5f60 |
|
BLAKE2b-256 | 08d9c9fce4e9ba124386083f366bbfe28e6b4c31310223429527342bd21991d0 |