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.3b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dfaa24535408b6c245d2a1557719426c1ef8b2fafb10fbe8e807d75d6ab120b |
|
MD5 | 358e257368c381d155e9ada22aea9574 |
|
BLAKE2b-256 | 5dd9523cbc7c3b251aaf39cb0622858ea6cbf20fcc1787fe27e6bdb9db4dda17 |
Close
Hashes for flask_feature_flag-0.0.3b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59dd0f05047aba5fa33918f7e5fe712c93cb38f993937aa0eaedd45bef67ca9a |
|
MD5 | 6fa8f21c6e28428829322ffcf43cb568 |
|
BLAKE2b-256 | 893ba7037bdf014d01157cf1f9e317791d2fcfbadbbd2c236966efc35e67d6f3 |