File: installation.rst

package info (click to toggle)
python-django-csp 3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 300 kB
  • sloc: python: 935; makefile: 135; sh: 6
file content (29 lines) | stat: -rw-r--r-- 688 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
.. _installation-chapter:

=====================
Installing django-csp
=====================

First, install django-csp via pip or from source::

    # pip
    $ pip install django-csp

::

    # source
    $ git clone https://github.com/mozilla/django-csp.git
    $ cd django-csp
    $ python setup.py install

Now edit your project's ``settings`` module, to add the django-csp middleware
to ``MIDDLEWARE``, like so::

    MIDDLEWARE = (
        # ...
        'csp.middleware.CSPMiddleware',
        # ...
    )
Note: Middleware order does not matter unless you have other middleware modifying the CSP header.

That should do it! Go on to :ref:`configuring CSP <configuration-chapter>`.