diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-13 16:50:00 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-14 10:33:51 -0500 |
| commit | 92c5eeac3358e8243e29604d51b724f46fd5305f (patch) | |
| tree | de691be2b05c905eb71934eee8870ffa76759462 /docs/ref | |
| parent | 7da37699e8d7124f5d0cfaba931772333c24ef83 (diff) | |
Fixed #27598 -- Allowed specifying directories for a filesystem template loader.
Thanks Carl Meyer for review.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/api.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 55a1a314b1..2057c370f3 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -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 |
