Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
Update documentation to explain how to load the 'csp' template tag
  • Loading branch information
dannyrohde committed Aug 25, 2020
1 parent ea107ab commit c82de07
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/nonce.rst
Expand Up @@ -50,6 +50,36 @@ This tag will output a properly nonced script every time. For the sake of syntax

Django:

To enable the loading of the 'csp' tag in templates, you'll need to add the CSP template tags to the TEMPLATES section of your settings file..

.. code-block:: python
TEMPLATES = [
{
"OPTIONS": {
'libraries': {
'csp': 'csp.templatetags.csp',
}
},
}
]
Then you can load the 'csp' template tags and use 'script' in the template:

To enable the loading of the 'csp' tag in templates, you'll need to add the CSP template tags to the TEMPLATES settings.

.. code-block:: python
TEMPLATES = [
{
"OPTIONS": {
'libraries': {
'csp': 'csp.templatetags.csp',
}
},
}
]
.. code-block:: jinja
{% load csp %}
Expand Down

0 comments on commit c82de07

Please sign in to comment.