Django Unfold Settings
A reusable Django package for managing global application settings with multiple data types via the modern django-unfold admin interface. Features strict validation, automated cache management, and a high-performance flat JSON API.
Features
- Strict Type Validation: EAV-inspired architecture with dedicated tables for each data type (
string,text,html,int,float,bool,json,date,datetime,file). - Unfold Admin Integration: Responsive UI using Unfold
TabularInlinecomponents. - High Performance: Optimized querying fetches all configs in exactly 1 SQL query.
- Automated Caching: Built-in cache layer with dynamic TTL and instant invalidation via signals.
Requirements
- Python >= 3.10
- Django >= 4.2
- django-unfold >= 0.20.0
Installation
- Install the package:
pip install django-unfold-settings
- Add
unfoldandunfold_settingstoINSTALLED_APPSinsettings.py:
INSTALLED_APPS = [
"unfold",
"unfold_settings",
# ...
]
- Run migrations:
python manage.py migrate
- Include the API routing in your core
urls.py:
from django.urls import path, include
urlpatterns = [
path("api/settings/", include("unfold_settings.urls")),
]
Cache Configuration
You can control the API cache lifetime in settings.py:
# Cache timeout in seconds (Default: 3600 / 1 hour)
APP_SETTINGS_CACHE_TTL = 7200
# Disable caching completely
APP_SETTINGS_CACHE_TTL = 0
API Output
The endpoint /api/settings/settings/ returns a flat JSON dictionary:
{
"SITE_NAME": "My App",
"MAINTENANCE_MODE": false,
"CONFIG": {"api_key": "12345"},
"PROJECT_LOGO": "/media/uploads/settings/LOGO/logo.png"
}
License
MIT
Metadata
Release files for django-unfold-settings 1.2.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_unfold_settings-1.2.0.tar.gz | 8.1 kB | Without provenance | Details for django_unfold_settings-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_unfold_settings-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for django_unfold_settings-1.2.0-py3-none-any.whl |
Total release size: 19.5 kB
Release files / django_unfold_settings-1.2.0.tar.gz
| Download URL | django_unfold_settings-1.2.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9975e2b87e9b96899877c21a345caa4b8446582d2ffd5c57edd1e22b58437ec9
|
|
BLAKE2b-256 checksum How to use checksums |
934daec6dda1130585fe48bd456a68e04c76ae3579e78eb8db18351df22ddb94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / django_unfold_settings-1.2.0-py3-none-any.whl
| Download URL | django_unfold_settings-1.2.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33d22fbc5509a0f419e0455450e8197429d57b57f0252c3977fe3e51b1345e07
|
|
BLAKE2b-256 checksum How to use checksums |
04468f3e0635027e8cb06e0f4bc0dbd5381c71577e86897dfbad244ff42829df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for django-unfold-settings 1.2.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.