summaryrefslogtreecommitdiff
path: root/django/views/generic/base.py
AgeCommit message (Collapse)Author
2026-01-31Refs #34118 -- Removed asgiref coroutine detection shims.Jacob Walls
As Python 3.12 is now the floor, we can drop the shims and use the `inspect` module.
2025-10-12Optimized View.dispatch() a bit.sobolevn
2025-09-22Fixed #36488 -- Fixed merging of query strings in RedirectView.Samriddha9619
Co-authored-by: Ethan Jucovy <ethan.jucovy@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-06-06Refs CVE-2025-48432 -- Prevented log injection in remaining response logging.Jake Howard
Migrated remaining response-related logging to use the `log_response()` helper to avoid potential log injection, to ensure untrusted values like request paths are safely escaped. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2022-12-20Refs #34118 -- Adopted asgiref coroutine detection shims.Carlton Gibson
Thanks to Mariusz Felisiak for review.
2022-09-29Fixed #34062 -- Updated View.http_method_not_allowed() to support async.Antoine Lorence
As with the options() methods, wrap the response in a coroutine if the view is async. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-04-07Fixed #33611 -- Allowed View subclasses to define async method handlers.Carlton Gibson
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-03-30Fixed #32260 -- Made View.as_view() do not use update_wrapper().Daniyal
View.as_view() should not use update_wrapper() for copying attributes it's unintended and have side-effects such as adding `self` to the signature. This also fixes system check for arguments of custom error handler views with class-based views. Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2020-09-14Fixed #31789 -- Added a new headers interface to HttpResponse.Tom Carrick
2020-08-24Fixed #31877 -- Reverted "Fixed #19878 -- Deprecated TemplateView passing ↵Mariusz Felisiak
URL kwargs into context." This reverts commit 4ed534758cb6a11df9f49baddecca5a6cdda9311.
2020-08-24Refs #31877 -- Reverted "Fixes #31877 -- Used lazy() for TemplateView kwarg ↵Mariusz Felisiak
deprecation warning." This reverts commit 20799cc0a6d98816b9ef0577e24691bd26b80d7d.
2020-08-13Fixes #31877 -- Used lazy() for TemplateView kwarg deprecation warning.Adam Johnson
SimpleLazyObjects cause a crash when filtering. Thanks Tim L. White for the report. Regression in 4ed534758cb6a11df9f49baddecca5a6cdda9311.
2020-03-23Fixed #19878 -- Deprecated TemplateView passing URL kwargs into context.Adam Johnson
2020-01-06Removed "Don't do that" from docs and error messages.Adam Johnson
It's slightly aggressive and doesn't explain itself.
2019-10-30Refs #20456 -- Moved initialization of HEAD method based on GET to the ↵Felipe Lee
View.setup() for generic views. This will ease unit testing of views since setup will essentially do everything needed to set the view instance up (other than instantiating it). Credit for idea goes to Vincent Prouillet.
2018-12-21Fixed #29750 -- Added View.setup() hook for class-based views.François Freitag
2017-11-14Fixed #28795 -- Removed 'not in' checks and used dict.setdefault().Дилян Палаузов
2017-07-06Fixed #28331 -- Added ContextMixin.extra_context to allowing passing context ↵Bruno Alla
in as_view().
2017-03-03Refs #27656 -- Updated django.views docstring verbs according to PEP 257.Anton Samarchyan
2017-03-01Fixed #26911 -- Removed NoReverseMatch silencing in RedirectView.Grzegorz Tężycki
2017-02-27Imported django.http classes instead of django.http.Asif Saifuddin Auvi
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2015-12-31Fixed #26013 -- Moved django.core.urlresolvers to django.urls.Marten Kenbeek
Thanks to Tim Graham for the review.
2015-10-22Fixed "URLconf" spelling in code comments.Tim Graham
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-03Fixed #24168 -- Allowed selecting a template engine in a few APIs.Aymeric Augustin
Specifically in rendering shortcuts, template responses, and class-based views that return template responses. Also added a test for render_to_response(status=...) which was missing from fdbfc980. Thanks Tim and Carl for the review.
2015-01-18Changed RedirectView.permanent to False per deprecation timeline; refs #21587.Tim Graham
2015-01-17Fixed #24055 -- Keep reference to view class for resolve()Collin Anderson
2014-11-28Corrected deprecation warnings for RedirectView; refs #21587.Berker Peksag
2014-11-25Fixed #21587 -- Added a warning for changing default of RedirectView.permanent.Berker Peksag
2013-12-16Fixed #21564 -- Use local request object when possible in generic views.Baptiste Mispelon
Thanks to trac user adepue for the report and original patch.
2013-11-03Fixed flake8 E251 violationsMilton Mazzarri
2013-06-14Fixed #15273 -- Extend RedirectView to allow reversal by name.Marc Tamlyn
Thanks to @DrMeers for the report and @ludwigkraatz for the initial patch.
2013-05-22Fixed #20478 – Added support for HTTP PATCH method in generic views.Krzysztof Jurewicz
2013-01-30Fixed #19076 -- Added content_type attribute to TemplateView.Aymeric Augustin
Thanks Gavin Wahl.
2012-11-22Fixed #19316 -- Set View args/kwargs/request before dispatchGeorge Hickman
2012-11-22Clarified usage of as_view kwargs for setting arguments on class based viewsTim Graham
Thanks Dave McLain for the patch.
2012-10-20Fixed #7581 -- Added streaming responses.Aymeric Augustin
Thanks mrmachine and everyone else involved on this long-standing ticket.
2012-09-20Imported getLogger directly from logging moduleClaude Paroz
This was a remainder of some 2.4 compatibility code.
2012-08-18Fixed #17228 -- params context variable is inconsistentMarc Tamlyn
Remove the params variable from the context and just put the variables in directly. This had not been committed previously as the original pattern was used in the functional generic views and we wanted consistency between them, but django.views.generic.simple.direct_to_template is now gone so we can do it 'right'.
2012-08-18Fixed #16744 -- Class based view should have the view object in the contextMarc Tamlyn
Updated the most recent patch from @claudep to apply again and updated the documentation location.
2012-08-07[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-06-11Fixed #18451 -- Vastly improved class based view documentation.Jannis Leidel
Many thanks to Daniel Greenfeld, James Aylett, Marc Tamlyn, Simon Williams, Danilo Bargen and Luke Plant for their work on this.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-05-17Fixed #17449 -- Added OPTIONS to generic views.Aymeric Augustin
Thanks estebistec for the report and patch.
2012-04-06Fixed #16074 -- Added ContextMixin to class-based generic views to handle ↵Claude Paroz
get_context_data. Thanks emyller, Luke Plant, Preston Holmes for working on the ticket and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17875 bcc190cf-cafb-0310-a4f2-bffc1f526a37