django-dbtemplates-iplweb
dbtemplates is a Django app that stores templates in the database and
exposes them through a regular Django template loader — so templates can be
edited from the admin instead of being redeployed as files.
Originally developed by Jannis Leidel and Jazzband. This fork is actively maintained by IPLweb.
Support graciously provided by
Why?
Django's built-in template loaders read from the filesystem or app
directories. That works well for developer-owned templates, but not for
content that needs to change without a deploy (marketing copy, transactional
email bodies, error pages, site-specific overrides). dbtemplates adds a
loader that reads templates from a database model, so non-developers can
edit them via the admin and changes take effect immediately.
Features
- Database-backed Django template loader — drop-in with the standard
TEMPLATES.OPTIONS.loaderschain - Edit templates through the Django admin (syntax highlighting included)
- Multi-site support via
django.contrib.sites— the same template name can resolve to different content per site - Cache integration with Django's cache framework; invalidation on save
- Management commands:
sync_templates— bidirectional sync between the database and filesystem templatescheck_template_syntax— validate all stored templatescreate_error_templates— scaffold404.html/500.htmlrows
- Admin actions and optional versioned storage
Supported versions
Python
| 3.10 | 3.11 | 3.12 | 3.13 |
|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ |
Django
| Django \ Python | 3.10 | 3.11 | 3.12 | 3.13 |
|---|---|---|---|---|
| 4.2 LTS | ✓ | ✓ | ✓ | ✗ |
| 5.2 LTS | ✓ | ✓ | ✓ | ✓ |
| 6.0 | ✗ | ✗ | ✓ | ✓ |
| 6.1 | ✗ | ✗ | ✓ | ✓ |
Matrix derived from tox.ini and Django's own Python support matrix.
Django 6.0 and 6.1 require Python 3.12 or newer.
Installation
Using uv (recommended)
uv add django-dbtemplates-iplweb
Using pip
pip install django-dbtemplates-iplweb
The Python import name stays dbtemplates, so no code changes are needed
when migrating from upstream django-dbtemplates:
from dbtemplates.models import Template
From git (latest main)
uv add "git+https://github.com/mpasternak/django-dbtemplates-iplweb.git"
# or
pip install "git+https://github.com/mpasternak/django-dbtemplates-iplweb.git"
Quick start
-
Add
dbtemplatestoINSTALLED_APPSalongsidedjango.contrib.sitesanddjango.contrib.admin:INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.sites", "django.contrib.admin", "dbtemplates", ]
-
Add
dbtemplates.loader.LoadertoTEMPLATES.OPTIONS.loaders:TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "OPTIONS": { "loaders": [ "django.template.loaders.filesystem.Loader", "django.template.loaders.app_directories.Loader", "dbtemplates.loader.Loader", ], }, }, ]
Put
dbtemplates.loader.Loaderlast to use database templates as a fallback, or first to let them override on-disk templates. -
Apply migrations and start the server:
python manage.py migrate python manage.py runserver
-
Open the admin, go to Database templates → Templates, and create entries with a
name(e.g.blog/entry_list.html) and templatecontent.
See https://django-dbtemplates.readthedocs.io/ for the complete documentation.
Links
- Documentation: https://django-dbtemplates.readthedocs.io/
- Changelog: https://django-dbtemplates.readthedocs.io/en/latest/changelog.html
- Upstream source: https://github.com/jazzband/django-dbtemplates
- This fork: https://github.com/mpasternak/django-dbtemplates-iplweb
License
BSD — see LICENSE for details.
Release files for django-dbtemplates-iplweb 4.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_dbtemplates_iplweb-4.4.1.tar.gz | 85.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_dbtemplates_iplweb-4.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 177.4 kB
Release files / django_dbtemplates_iplweb-4.4.1.tar.gz
| Download URL | django_dbtemplates_iplweb-4.4.1.tar.gz |
|---|---|
| Size | 85.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6c88244b33ee4108e8c451c0208bd3a2b7ab47c1191f154e99cc298e6d254b1
|
|
BLAKE2b-256 checksum How to use checksums |
fa023940dd656449f6e39d903857f41373d96725e18f567d85fd9c0df95f7d62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / django_dbtemplates_iplweb-4.4.1-py3-none-any.whl
| Download URL | django_dbtemplates_iplweb-4.4.1-py3-none-any.whl |
|---|---|
| Size | 91.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c576bb77b6e1c3cfb460c5be6f28987cd0216fe5594596f4de8bdb1531d8f6d
|
|
BLAKE2b-256 checksum How to use checksums |
3f231dcc780257df1d064c44befbca87f481030d713000f0e234bdeb8edbbfeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|