Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/nonce.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
==============================
Using the generated CSP nonce
==============================
When ``CSP_INCLUDE_NONCE_IN`` is configured, the nonce value is returned in the CSP header. To actually make the browser do anything with this value, you will need to include it in the attributes of the tags that you wish to mark as safe.
When ``CSP_INCLUDE_NONCE_IN`` is configured, the nonce value is returned in the CSP headers **if it is used**, e.g. by evaluating the nonce in your template.
To actually make the browser do anything with this value, you will need to include it in the attributes of
the tags that you wish to mark as safe.


.. Note::
Expand Down Expand Up @@ -34,6 +36,10 @@ This value can be accessed directly on the request object in any view or templat

Assuming the ``CSP_INCLUDE_NONCE_IN`` list contains the ``script-src`` directive, this will result in the above script being allowed.

.. Note::

The nonce will only be added to the CSP headers if it is used.


``Context Processor``
=====================
Expand Down