Skip to content

Terralego/django-template-model

Repository files navigation

Build Status PyPI version Maintainability codecov Python Version Django Version

django-template-model

Description

This application will allow you to store templates in your database, and discovering with any Template Engine

Setup

Edit your settings file as follows:

INSTALLED_APPS = [
    ...
    template_model,
]
TEMPLATES = [
  {
      'BACKEND': 'django.template.backends.django.DjangoTemplates',
      'DIRS': [ # your template dirs here
      ],
      'APP_DIRS': False,  # Disable auto discovering
      'OPTIONS': {
          'context_processors': [
              'django.contrib.auth.context_processors.auth',
              'django.template.context_processors.debug',
              'django.template.context_processors.i18n',
              'django.template.context_processors.media',
              'django.template.context_processors.static',
              'django.template.context_processors.tz',
              'django.contrib.messages.context_processors.messages',
              'django.template.context_processors.request',
          ],
          'loaders': [
              'django.template.loaders.filesystem.Loader',
              'django.template.loaders.app_directories.Loader',
              # add loader here if you want to use it with this backend
              'template_model.loader.Loader',
          ],
      },
  },