Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #35401 -- Documented the conditional page decorator. #18150

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/ref/csrf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class-based views<decorating-class-based-views>`.

.. function:: csrf_protect(view)

Decorator that provides the protection of ``CsrfViewMiddleware`` to a view.
Decorator that provides the protection of
:class:`~django.middleware.csrf.CsrfViewMiddleware` to a view.

Usage::

Expand Down
6 changes: 6 additions & 0 deletions docs/ref/middleware.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ header, the middleware adds one if needed. If the response has an ``ETag`` or
``If-Modified-Since``, the response is replaced by an
:class:`~django.http.HttpResponseNotModified`.

You can handle conditional GET operations with individual views using the
:func:`~django.views.decorators.http.conditional_page()` decorator.

Locale middleware
-----------------

Expand Down Expand Up @@ -569,6 +572,9 @@ Adds protection against Cross Site Request Forgeries by adding hidden form
fields to POST forms and checking requests for the correct value. See the
:doc:`Cross Site Request Forgery protection documentation </ref/csrf>`.

You can add Cross Site Request Forgery protection to individual views using the
:func:`~django.views.decorators.csrf.csrf_protect()` decorator.

``X-Frame-Options`` middleware
------------------------------

Expand Down
5 changes: 5 additions & 0 deletions docs/topics/http/decorators.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ control caching behavior on particular views.

.. function:: condition(etag_func=None, last_modified_func=None)

.. function:: conditional_page()

This decorator provides the conditional GET operation handling of
:class:`~django.middleware.http.ConditionalGetMiddleware` to a view.

.. function:: etag(etag_func)

.. function:: last_modified(last_modified_func)
Expand Down