mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue