mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
feat(django 1.9): Move jinja2 tags out of templatetags folders
Django 1.9 now automatically imports all models in templatetags. This causes ImportErrors to be raised for users who do not have jinja2 installed.
This commit is contained in:
parent
7f97b05f1a
commit
960d7aa575
@ -9,6 +9,10 @@ Wagtail supports Jinja2 templating for all front end features. More information
|
||||
Configuring Django
|
||||
==================
|
||||
|
||||
.. versionchanged:: 1.3
|
||||
|
||||
Jinja2 tags were moved from "templatetags" into "jinja2tags" to separate them from Django template tags.
|
||||
|
||||
Django needs to be configured to support Jinja2 templates. As the Wagtail admin is written using regular Django templates, Django has to be configured to use both templating engines. Wagtail supports the Jinja2 backend that ships with Django 1.8 and above. Add the following configuration to the ``TEMPLATES`` setting for your app:
|
||||
|
||||
.. code-block:: python
|
||||
@ -20,9 +24,9 @@ Django needs to be configured to support Jinja2 templates. As the Wagtail admin
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'extensions': [
|
||||
'wagtail.wagtailcore.templatetags.jinja2.core',
|
||||
'wagtail.wagtailadmin.templatetags.jinja2.userbar',
|
||||
'wagtail.wagtailimages.templatetags.jinja2.images',
|
||||
'wagtail.wagtailcore.jinja2tags.core',
|
||||
'wagtail.wagtailadmin.jinja2tags.userbar',
|
||||
'wagtail.wagtailimages.jinja2tags.images',
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ if django.VERSION >= (1, 8):
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'extensions': [
|
||||
'wagtail.wagtailcore.templatetags.jinja2.core',
|
||||
'wagtail.wagtailadmin.templatetags.jinja2.userbar',
|
||||
'wagtail.wagtailimages.templatetags.jinja2.images',
|
||||
'wagtail.wagtailcore.jinja2tags.core',
|
||||
'wagtail.wagtailadmin.jinja2tags.userbar',
|
||||
'wagtail.wagtailimages.jinja2tags.images',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -3,7 +3,7 @@ from __future__ import absolute_import
|
||||
import jinja2
|
||||
from jinja2.ext import Extension
|
||||
|
||||
from .wagtailuserbar import wagtailuserbar
|
||||
from .templatetags.wagtailuserbar import wagtailuserbar
|
||||
|
||||
|
||||
class WagtailUserbarExtension(Extension):
|
@ -3,7 +3,7 @@ from __future__ import absolute_import
|
||||
import jinja2
|
||||
from jinja2.ext import Extension
|
||||
|
||||
from .wagtailcore_tags import pageurl, richtext, slugurl, wagtail_version
|
||||
from .templatetags.wagtailcore_tags import pageurl, richtext, slugurl, wagtail_version
|
||||
|
||||
|
||||
class WagtailCoreExtension(Extension):
|
Loading…
Reference in New Issue
Block a user