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.3b2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dfd156de8428be2913ad4669c622e09bc39ca39a6596f17c4f0d11c242d906f |
|
MD5 | c6ec27f7b8a03fe4b8e7ae6ba9c344c7 |
|
BLAKE2b-256 | b0b4be1cd5a6c09943ee12e3412a3f1766cef8889e5094842ca2270a0525631d |
Close
Hashes for flask_feature_flag-0.0.3b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3963e9cf6228fdaf022aa1688b88d19bbef4ef85475c42b455840cccfd3d420b |
|
MD5 | ecfb807e7d0b20e169a0fbe08863a4ce |
|
BLAKE2b-256 | 27e74ba990e55698301857215bc4808766b8715b95c6e08a273644af0bfd7f4e |