Feature flags for Wagtail sites
Project description
Wagtail-Flags
Feature flags allow you to toggle functionality in the Wagtail based on configurable conditions.
Wagtail-Flags adds a Wagtail admin UI and Wagtail Site-based condition on top of Django-Flags. For a more complete overview of feature flags and how to use them, please see the Django-Flags documentation.
- Dependencies
- Installation
- Usage
- Extended conditions
- Getting help
- Getting involved
- Licensing
- Credits and references
Dependencies
- Django 1.8+ (including Django 2.0)
- Wagtail 1.10+ (including Wagtail 2.0)
- Django-Flags 3.0+
- Python 2.7+, 3.6+
Installation
- Install wagtail-flags:
pip install wagtail-flags
- Add
flags
andwagtailflags
as installed apps in your Djangosettings.py
:
INSTALLED_APPS = (
...
'flags',
'wagtailflags',
...
)
Usage
Please see the Django-Flags documentation for the most current information about defining and checking feature flags.
First, define the flag in Django settings.py
:
FLAGS = {
'MY_FLAG': {}
}
Then use the flag in a Django template (mytemplate.html
):
{% load feature_flags %}
{% flag_enabled 'MY_FLAG' as my_flag %}
{% if my_flag %}
<div class="flagged-banner">
I’m the result of a feature flag.
</div>
{% endif %}
Next, configure a URL for that template (urls.py
):
from django.urls import path
from django.views.generic import TemplateView
urlpatterns = [
path(r'mypage/', TemplateView.as_view(template_name='mytemplate.html')),
]
Finally, add conditions for the flag in the Wagtail admin under "Settings", "Flags":
Extended conditions
Wagtail-Flags adds the following conditions to Django-Flags:
site
Allows a flag to be enabled for a Wagtail site that matches the hostname and port in the condition value.
FLAGS = {'MY_FLAG': {'site': 'staging.mysite.com'}}
Getting help
Please add issues to the issue tracker.
Getting involved
General instructions on how to contribute can be found in CONTRIBUTING.
Licensing
Credits and references
- Forked from cfgov-refresh
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
File details
Details for the file wagtail-flags-4.0.0.tar.gz
.
File metadata
- Download URL: wagtail-flags-4.0.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4571127b219216516a0ec327d5eccb22c5801f54774c58beeb377c5fb3e5756d |
|
MD5 | 1409335152b79d0a1e671566d023eb20 |
|
BLAKE2b-256 | 5cf0f28d2d724dfe2b149568cdc620a8a267e4ed2f8ef7f4ed7d0c44f41b5180 |
Provenance
File details
Details for the file wagtail_flags-4.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: wagtail_flags-4.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da8c464378bbea35a5178226772ac3b2f3353f2ff7098ed071ab2b48e364c266 |
|
MD5 | 384ed440fd3629e2df20daf852833b5f |
|
BLAKE2b-256 | 3b59c5e47c21bb857cb3c515c6b732608e3d3b9f5a0b3837022e010fb606c6f0 |