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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_dbtemplates_iplweb-4.4.1.tar.gz (85.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_dbtemplates_iplweb-4.4.1-py3-none-any.whl (91.9 kB view details)

Uploaded Python 3

File details

Details for the file django_dbtemplates_iplweb-4.4.1.tar.gz.

File metadata

  • Download URL: django_dbtemplates_iplweb-4.4.1.tar.gz
  • Upload date:
  • Size: 85.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for django_dbtemplates_iplweb-4.4.1.tar.gz
Algorithm Hash digest
SHA256 e6c88244b33ee4108e8c451c0208bd3a2b7ab47c1191f154e99cc298e6d254b1
MD5 c11fad9ce6019d283f615b744edb3400
BLAKE2b-256 fa023940dd656449f6e39d903857f41373d96725e18f567d85fd9c0df95f7d62

See more details on using hashes here.

File details

Details for the file django_dbtemplates_iplweb-4.4.1-py3-none-any.whl.

File metadata

  • Download URL: django_dbtemplates_iplweb-4.4.1-py3-none-any.whl
  • Upload date:
  • Size: 91.9 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for django_dbtemplates_iplweb-4.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c576bb77b6e1c3cfb460c5be6f28987cd0216fe5594596f4de8bdb1531d8f6d
MD5 0bfdc18fab05488104fa1ca70efb0ce7
BLAKE2b-256 3f231dcc780257df1d064c44befbca87f481030d713000f0e234bdeb8edbbfeb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page