1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Deprecated current_app in TemplateResponse and render(_to_response).

This commit is contained in:
Aymeric Augustin
2014-12-14 17:48:51 +01:00
parent e53495ba33
commit cf1f36bb6e
18 changed files with 197 additions and 56 deletions

View File

@@ -1204,6 +1204,21 @@ to construct the "view on site" URL. This URL is now accessible using the
sure to provide a default value for the ``form_class`` argument since it's
now optional.
``current_app`` argument of template-related APIs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following functions and classes will no longer accept a ``current_app``
parameter to set an URL namespace in Django 2.0:
* ``django.shortcuts.render()``
* ``django.template.Context()``
* ``django.template.RequestContext()``
* ``django.template.response.TemplateResponse()``
Set ``request.current_app`` instead, where ``request`` is the first argument
to these functions or classes. If you're using a plain ``Context``, use a
``RequestContext`` instead.
``dictionary`` and ``context_instance`` arguments of rendering functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~