CSP WARN: Directive ”...” violated by

This warning appears in the Error Console when your site uses Content Security Policy without making an exception for the external JavaScript include.

To fix this, include in your script-src and frame-src directive. If you’re using the django-csp library, the following settings will work:

CSP_SCRIPT_SRC = ("'self'",')
CSP_FRAME_SRC = ("'self'", '')

Login fails silently due to cache issues

Another possible cause of silently failing logins is an issue with having no cache configured locally. Several projects (especially projects based on playdoh, which uses django-session-csrf) store session info in the cache rather than the database, and if your local instance has no cache configured, the session information will not be stored and login will fail silently.

To solve this issue, you should configure your local instance to use an in-memory cache with the following in your local settings file:

    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
        'LOCATION': 'unique-snowflake'

Project Versions

Table Of Contents

Previous topic


Next topic


This Page