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.3b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c345f7b56bc580a9f8c41607b30a119ad5a736af13a44f0e7f56d4580ca44b4d |
|
MD5 | 704f202eaad0dd1aa7c2d68804f6a98d |
|
BLAKE2b-256 | 9812e059c2a39e4439abcdcfa7c2c641ce3852d42e0b8197c94a17af3fefe7f2 |
Close
Hashes for flask_feature_flag-0.0.3b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d40beb6bf8e8ff208e4624b40c04166cf74d24180350a9b6eaf69440d8793a7 |
|
MD5 | f284b9290fc39fa110f57c8433e90c24 |
|
BLAKE2b-256 | 2645f06eac6a7f8d9ef29a7ac5d1d609859eb62aca0a30d705f829dbcbe8755c |