mirror of
https://github.com/django/django.git
synced 2025-09-13 22:16:28 +00:00
Fixed #27598 -- Allowed specifying directories for a filesystem template loader.
Thanks Carl Meyer for review.
This commit is contained in:
parent
7da37699e8
commit
92c5eeac33
4 changed files with 39 additions and 1 deletions
|
@ -847,6 +847,26 @@ loaders that come with Django:
|
|||
'DIRS': [os.path.join(BASE_DIR, 'templates')],
|
||||
}]
|
||||
|
||||
You can also override ``'DIRS'`` and specify specific directories for a
|
||||
particular filesystem loader::
|
||||
|
||||
TEMPLATES = [{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'OPTIONS': {
|
||||
'loaders': [
|
||||
(
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
[os.path.join(BASE_DIR, 'templates')],
|
||||
),
|
||||
],
|
||||
},
|
||||
}]
|
||||
|
||||
.. versionchanged:: 1.11
|
||||
|
||||
The ability to specify directories for a particular filesystem loader
|
||||
was added.
|
||||
|
||||
``django.template.loaders.app_directories.Loader``
|
||||
|
||||
.. class:: app_directories.Loader
|
||||
|
|
|
@ -391,6 +391,9 @@ Templates
|
|||
* Added a :ttag:`resetcycle` template tag to allow resetting the sequence of
|
||||
the :ttag:`cycle` template tag.
|
||||
|
||||
* You can now specify specific directories for a particular
|
||||
:class:`filesystem.Loader <django.template.loaders.filesystem.Loader>`.
|
||||
|
||||
Tests
|
||||
~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue