Fixed #19878 -- Deprecated TemplateView passing URL kwargs into context.

This commit is contained in:
Adam Johnson 2019-08-15 06:48:33 +01:00 committed by Mariusz Felisiak
parent f982f0bdb8
commit 4ed534758c
6 changed files with 84 additions and 29 deletions

View file

@ -117,8 +117,7 @@ MRO is an acronym for Method Resolution Order.
.. class:: django.views.generic.base.TemplateView
Renders a given template, with the context containing parameters captured
in the URL.
Renders a given template.
**Ancestors (MRO)**
@ -162,12 +161,17 @@ MRO is an acronym for Method Resolution Order.
**Context**
* Populated (through :class:`~django.views.generic.base.ContextMixin`) with
the keyword arguments captured from the URL pattern that served the view.
* Populated (through :class:`~django.views.generic.base.ContextMixin`).
* You can also add context using the
:attr:`~django.views.generic.base.ContextMixin.extra_context` keyword
argument for :meth:`~django.views.generic.base.View.as_view`.
.. deprecated:: 3.1
Starting in Django 4.0, the keyword arguments captured from the URL
pattern won't be passed to the context. Reference them with
``view.kwargs`` instead.
``RedirectView``
================