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.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e76c1451cb1c76073d1486c665abf4964c083a56da27b40166cd43f177e98bba |
|
MD5 | 9882c421ce8e3fc8b9b657eb27d743db |
|
BLAKE2b-256 | 36202434906abb243ee277014aff962a71ea2ba03ead6803b3debd00d24e9040 |