.. _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_CLASSES``, like so::

    MIDDLEWARE_CLASSES = (
        # ...
        'csp.middleware.CSPMiddleware',
        # ...
    )

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

.. _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',
        # ...
    )

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

Drop obsolete MIDDLEWARE_CLASSES for MIDDLEWARE
Drop obsolete MIDDLEWARE_CLASSES for MIDDLEWARE

In Django 1.10, MIDDLEWARE replaces MIDDLEWARE_CLASSES.