A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bittner/django-apptemplates below:

bittner/django-apptemplates: Django template loader that allows you to load and override a template from a specific Django application.

Django apptemplates

django-apptemplates is a Django template loader that allows you to load a template from a specific application. By this you can both extend and override a template at the same time. The default Django loaders require you to copy the entire template you want to override, even if you only want to override one small block.

Based on: http://djangosnippets.org/snippets/1376/

django-apptemplates is tested against the officially supported combinations of Python and Django, since Django 1.4 (Django 1.4 to 3.0 on Python 2.7, and 3.4 to 3.8).

Installation, Setup and Use

This package is available from PyPI. To install it simply execute:

$ pip install django-apptemplates
Settings (for Django 1.8+)
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'OPTIONS': {
            'loaders': [
                'apptemplates.Loader',
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
            ],
        },
    },
]
Settings (for Django < 1.8)
TEMPLATE_LOADERS = (
    'apptemplates.Loader',
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

Template usage example (extend and override Django admin base template):

{% extends "admin:admin/base.html" %}

The part before the colon (:) is called the Django app namespace.

Skipped to fix conflicting versioning in setup.py and the PyPI package


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4