Flask feature flag
Project description
Flask feature flag
Tool to activate and deactivate project functionalities
Environment
- Create
$ python3 -m venv venv
- Activate
$ source venv/bin/activate
- Deactivate
$ deactivate
Package installation
-
Installation
$ pip3 install flask-feature-flag
-
You should add this to your
config.py
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.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7993d33fddf7553c0023bc31f69d2235ba769d47d87c28b6bc6de65b764706a |
|
MD5 | eb5df11d18679d5a82bf067b985b093d |
|
BLAKE2b-256 | afaa501ddcce142f51015e903aa774dd900eb8f3c360d8f085af1e3fd51e4f3f |