diff --git a/README.rst b/README.rst index 3d4dc91..5f09d01 100644 --- a/README.rst +++ b/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`` diff --git a/overextends/models.py b/overextends/models.py index 1f2e526..ffa1519 100644 --- a/overextends/models.py +++ b/overextends/models.py @@ -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")