Skip to main content

Django Unfold Settings

GitHub

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 TabularInline components.
  • 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

  1. Install the package:
pip install django-unfold-settings
  1. Add unfold and unfold_settings to INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    "unfold",
    "unfold_settings",
    # ...
]
  1. Run migrations:
python manage.py migrate
  1. 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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-unfold-settings 1.1.0
File Size Uploaded Provenance Actions
django_unfold_settings-1.1.0.tar.gz 9.8 kB Without provenance Details for django_unfold_settings-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-unfold-settings 1.1.0
File Interpreter ABI Platform Actions
django_unfold_settings-1.1.0-py3-none-any.whl Python 3 none any Details for django_unfold_settings-1.1.0-py3-none-any.whl

Total release size: 21.1 kB

Release files / django_unfold_settings-1.1.0.tar.gz

Download URL django_unfold_settings-1.1.0.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b4e01f266027023b84f9a354d810d4d006a6e02d2649ac00913aba9aae598f50
BLAKE2b-256 checksum
How to use checksums
4a704b3de448000720746fa6c79bce0788b62419805fdc2e8f3aced709e9b21c
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.1.0-py3-none-any.whl

Download URL django_unfold_settings-1.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5620a25db61595f266df36854bbf6d9cd778c0a0dd41dba184230f2fad6dcbac
BLAKE2b-256 checksum
How to use checksums
dbd92d89ef2c15ab76c5c967a4416514ff9c1f211b1cbb16d5fcb6489192fad6
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.1.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page