Installation#
Requirements#
Python 3.8 to 3.12 supported.
Django 3.2 to 5.0 supported.
Step (5) below assumes that you are using django-csp.
Installation#
Install with pip:
python -m pip install django-reporting-endpoints
Add django-reporting-endpoints to your
INSTALLED_APPS
:INSTALLED_APPS = [ ..., "reporting_endpoints", ..., ]
Configure your
REPORTING_ENDPOINTS
:REPORTING_ENDPOINTS = { "csp-violations": "/_/csp-reports/", }
Add the middleware:
MIDDLEWARE = [ ..., "reporting_endpoints.middleware.ReportingEndpointsMiddleware", ..., ]
Add the view to your urlconfig:
urlpatterns = [ ..., path( "_/csp-reports/", reporting_endpoint, kwargs={"endpoint_name": "csp-endpoint"} ), ]
Configure your
report-to
directives for the packages you use. For example, if you usedjango-csp
:CSP_REPORT_TO = "csp-violations"