mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Deprecated dirs argument to override TEMPLATE_DIRS.
Cancels 2f0566fa
. Refs #4278.
This commit is contained in:
parent
bcb693ebd4
commit
17012b6936
6 changed files with 68 additions and 36 deletions
|
@ -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``
|
||||
============
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue