Frontend Settings
Abstract
This project provides an API that expose settings and feature flags for the frontend.
It uses django-drf to create an endpoint to expose flags and settings configured in django-waffle and django-constance
Usage
Requirements Python (3.10–3.12; Django 6.x requires Python 3.12+) Django (4.2, 5.2 LTS, 6.0) Django REST Framework (3.15+)
Installation
Install using pip:
pip install django-frontend-settings
Add ‘frontend-settings’ to your INSTALLED_APPS setting.
INSTALLED_APPS = [
...
'frontend_settings',
]
Expose the view in your urls:
from django.urls import path
from frontend_settings.views import settings as frontend_settings_view
path("frontend-settings/", frontend_settings_view, name="frontend-settings"),
Then your flags from waffle and setting from constance should be returned on a get in this route:
$ curl 'http://localhost:8000/frontend-settings/'
{"data":{"flags":{"MY_FEATURE_FLAG":true},"settings":{}}}
In that case I had FRONTEND_MY_FEATURE_FLAG flag in waffle. The default prefix for flags is FRONTEND_, if you like to change it you can do by changing the following config on settings.py:
FRONTEND_SETTINGS = {
"WAFFLE_FLAG_PREFIX": "FRONTEND_", # Prefix used to filter out the flag that should be exposed in the endpoint
"CONSTANCE_KEY_PREFIX": "FRONTEND_", # Prefix used to filter out the settings in constance
}
Metadata
Release files for django-frontend-settings 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_frontend_settings-2.3.0.tar.gz | 11.2 kB | Without provenance | Details for django_frontend_settings-2.3.0.tar.gz |
Release files / django_frontend_settings-2.3.0.tar.gz
| Download URL | django_frontend_settings-2.3.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f1e862a59f04e26f73b9e06a2807d4d7b41f07bde44757b2bb5e21c400a4188
|
|
BLAKE2b-256 checksum How to use checksums |
ba3858e2f506a88954ca4e10c8c1b84e41aff96b0afdbe0d78c2cbed099bdd16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Security for django-frontend-settings 2.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.