def csp_middleware(get_response):
    """
    Adds Content Security Policy header
    """
    def middleware(request):
        response = get_response(request)

        response['Content-Security-Policy'] = \
            "default-src 'self'; script-src 'self'; style-src 'self'; report-uri /csp-report/"

        return response

    return middleware