diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-11-13 20:25:08 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-11-23 09:29:33 +0100 |
| commit | 17012b6936128fb771b98e4fa6d78caddd07a9a8 (patch) | |
| tree | b662345113691bc30944eec4f12a39400cec908b /docs | |
| parent | bcb693ebd4d3743cb194c6fd05b2d70fb9696a4c (diff) | |
Deprecated dirs argument to override TEMPLATE_DIRS.
Cancels 2f0566fa. Refs #4278.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/api.txt | 14 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 11 | ||||
| -rw-r--r-- | docs/topics/http/shortcuts.txt | 32 |
3 files changed, 27 insertions, 30 deletions
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 834e57e006..c86b7873ae 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -659,25 +659,27 @@ The Python API the template with the given name. If the template doesn't exist, it raises ``django.template.TemplateDoesNotExist``. - To override the :setting:`TEMPLATE_DIRS` setting, use the ``dirs`` - parameter. The ``dirs`` parameter may be a tuple or list. - .. versionchanged:: 1.7 The ``dirs`` parameter was added. + .. versionchanged:: 1.8 + + The ``dirs`` parameter was deprecated. + .. function:: select_template(template_name_list[, dirs]) ``select_template`` is just like ``get_template``, except it takes a list of template names. Of the list, it returns the first template that exists. - To override the :setting:`TEMPLATE_DIRS` setting, use the ``dirs`` - parameter. The ``dirs`` parameter may be a tuple or list. - .. versionchanged:: 1.7 The ``dirs`` parameter was added. + .. versionchanged:: 1.8 + + The ``dirs`` parameter was deprecated. + For example, if you call ``get_template('story_detail.html')`` and have the above :setting:`TEMPLATE_DIRS` setting, here are the files Django will look for, in order: diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 3175eecf5f..5f983fa2dc 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -1053,6 +1053,17 @@ The decorators :func:`~django.test.override_settings` and class decorators. As a consequence, when overriding ``setUpClass()`` or ``tearDownClass()``, the ``super`` implementation should always be called. +``dirs`` argument of template-finding functions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following functions no longer accept a ``dirs`` parameter to override +:setting:`TEMPLATE_DIRS`: + +* :func:`django.template.loader.get_template()` +* :func:`django.template.loader.select_template()` +* :func:`django.shortcuts.render()` +* :func:`django.shortcuts.render_to_response()` + ``django.template.loader.BaseLoader`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/http/shortcuts.txt b/docs/topics/http/shortcuts.txt index d64ec2f7cb..7a92b690e9 100644 --- a/docs/topics/http/shortcuts.txt +++ b/docs/topics/http/shortcuts.txt @@ -63,13 +63,14 @@ Optional arguments :ref:`namespaced URL resolution strategy <topics-http-reversing-url-namespaces>` for more information. -``dirs`` - A tuple or list of values to override the :setting:`TEMPLATE_DIRS` setting. - .. versionchanged:: 1.7 The ``dirs`` parameter was added. +.. versionchanged:: 1.8 + + The ``dirs`` parameter was deprecated. + Example ------- @@ -95,15 +96,6 @@ This example is equivalent to:: return HttpResponse(t.render(c), content_type="application/xhtml+xml") -If you want to override the :setting:`TEMPLATE_DIRS` setting, use the -``dirs`` parameter:: - - from django.shortcuts import render - - def my_view(request): - # View code here... - return render(request, 'index.html', dirs=('custom_templates',)) - ``render_to_response`` ====================== @@ -145,13 +137,14 @@ Optional arguments The MIME type to use for the resulting document. Defaults to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. -``dirs`` - A tuple or list of values to override the :setting:`TEMPLATE_DIRS` setting. - .. versionchanged:: 1.7 The ``dirs`` parameter was added. +.. versionchanged:: 1.8 + + The ``dirs`` parameter was deprecated. + Example ------- @@ -177,15 +170,6 @@ This example is equivalent to:: return HttpResponse(t.render(c), content_type="application/xhtml+xml") -If you want to override the :setting:`TEMPLATE_DIRS` setting, use the -``dirs`` parameter:: - - from django.shortcuts import render_to_response - - def my_view(request): - # View code here... - return render_to_response('index.html', dirs=('custom_templates',)) - ``redirect`` ============ |
