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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a8e3b5cc5a654d597287d5ad3f21d6d933678bcd294b1f7be5999b4490d3820 |
|
MD5 | 292492d990971d19842b31e48595bf56 |
|
BLAKE2b-256 | d5d7c0a0e7ca276cb2a9bdf1b0810dfcbba6fde3a7b93f6a30d7f3fec5bc0e73 |