13
README.rst
13
README.rst
@@ -90,6 +90,19 @@ django-overextends by adding the ``overextends`` app to the
|
||||
'overextends',
|
||||
)
|
||||
|
||||
For Django 1.9+ you must add overextends to the `builtins` key of your `TEMPLATES` setting::
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'builtins': ['overextends.templatetags.overextends_tags'],
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Note that while the ``overextends`` tag is provided by the package
|
||||
``overextends.templatetags.overextends_tags``, it is unnecessary to use
|
||||
``{% load overextends_tags %}`` in your templates. Like the ``extends``
|
||||
|
@@ -1,8 +1,8 @@
|
||||
|
||||
# This app doesn't contain any models, but as its template tags need to
|
||||
# be added to built-ins at start-up time, this is a good place to do it.
|
||||
import django
|
||||
|
||||
from django.template.base import add_to_builtins
|
||||
|
||||
|
||||
add_to_builtins("overextends.templatetags.overextends_tags")
|
||||
if django.VERSION < (1,9):
|
||||
from django.template.base import add_to_builtins
|
||||
add_to_builtins("overextends.templatetags.overextends_tags")
|
||||
|
Reference in New Issue
Block a user