Skip to main content

django-dbtemplates-iplweb

PyPI Tests Python Version Django Version License Documentation

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

IPLweb

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.loaders chain
  • 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 templates
    • check_template_syntax — validate all stored templates
    • create_error_templates — scaffold 404.html / 500.html rows
  • 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

  1. Add dbtemplates to INSTALLED_APPS alongside django.contrib.sites and django.contrib.admin:

    INSTALLED_APPS = [
        "django.contrib.auth",
        "django.contrib.contenttypes",
        "django.contrib.sessions",
        "django.contrib.sites",
        "django.contrib.admin",
        "dbtemplates",
    ]
    
  2. Add dbtemplates.loader.Loader to TEMPLATES.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.Loader last to use database templates as a fallback, or first to let them override on-disk templates.

  3. Apply migrations and start the server:

    python manage.py migrate
    python manage.py runserver
    
  4. Open the admin, go to Database templates → Templates, and create entries with a name (e.g. blog/entry_list.html) and template content.

See https://django-dbtemplates.readthedocs.io/ for the complete documentation.

Links

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)

Source distribution for django-dbtemplates-iplweb 4.4.1
File Size Uploaded
django_dbtemplates_iplweb-4.4.1.tar.gz 85.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-dbtemplates-iplweb 4.4.1
File Interpreter ABI Platform
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}

Release history Release notifications | RSS feed

This release

4.4.1 This release

2 release files

4.4.0

2 release files

4.3.2

2 release files

4.3.0

2 release files

4.1

2 release files

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