Flask feature flag
Project description
Flask feature flag
Tool to activate and deactivate project functionalities
Package installation
- Installation
$ pip3 install flask-feature-flag
Configuration
-
Feature flag type availables.
- FLASK_CONFIG
- MONGO
-
Define the following to your
config.py
FEATURE_FLAG_TYPE=
FEATURE_FLAG_TYPE
is required. -
You should add this to your
config.py
if it's feature typeFLASK_CONFIG
FEATURE_FLAGS = { 'ROUTE_ENABLED': os.environ.get('ROUTE_ENABLED', True) }
FEATURE_FLAGS
is required.
Docs
Example:
is_enabled
this decorator allows to activate or deactivate a functionality and receives as parameters a function to return in case feature is disabled and the name of the feature
```python
from flask_feature_flag import is_enabled
def error():
return dict(massage='this is a mistake')
@is_enabled(error, 'ENV_HELLO')
def hello(name):
return dict(message=f'Hi, {name}')
```
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 flask_feature_flag-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4849e2a172f054614f9f4f80cb995af81fe6fa1b970b233532f6337d88e3a90 |
|
MD5 | 8e28c80838a67cc859c7f668a6d359d4 |
|
BLAKE2b-256 | c3ffd514dac0700235448919c9a83bb1327ce5399341f27ab7da54cfa87d111c |