Don't import add_to_builtins on Django 1.9

Fixes #19
This commit is contained in:
Carlton Gibson
2015-10-09 22:27:16 +02:00
parent d2120a0114
commit 0a1d70fb12
2 changed files with 17 additions and 4 deletions

View File

@@ -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``

View File

@@ -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")