Skip to main content

Django plugin to add and configure the Cookie Control by Civic UK

Project description


A Django plugin to integrate the Civic UK Cookie Control (

The plugin is compatible with Django, DjangoCMS and Django/CMS multisite.


  • 2023-03-13 Remove deprecated NullBooleanField
  • 2020-08-21 Version 4.x + Updated to use Cookie Control version 9.x

To install

Install the application via pip:

pip install django-cookie-control

Add 'django_cookie_control' to installed apps:

INSTALLED_APPS = [ ... 'django_cookie_control', ...]

Add/Edit the following to if required with required cookies:

# DEFAULT if missing:
COOKIE_CONTROL_REQUIRED_COOKIES = ['csrftoken','django_language','sessionid','django_privacy_mgmt_preferences','AWSALB']

Run or make migrations:

python.exe migrate

To configure

For a full list of configuration settings see the Civic UK site, here:

Plugin configuration overview:

  1. Add a new configuration:

  2. Configure Main Settings:

    • Site name
    • API key
    • Cookie Control product version: Community, Pro, Pro Multisite

  3. Settings:

    • consentCookieExpiry
    • statement
    • logConsent
    • encodeCookie
    • subDomains

  4. IAB/CCPA Frameworks:

    • mode
    • publisherCC
    • iabCMP
    • iabConfig
    • iabText
    • ccpaConfig

  5. Appearance and Behaviour:

    • All other settings

  6. Accessibility:

    • Determines the accessibility helpers available, such as the accesskey and keyboard focus style.
  7. Cookies:

    • Necessary Cookies
      • A simple list of cookie names, including wildcards that are necessary for the site
      • A default list for Django, DjangoCMS, and AWS are already included.
    • Optional Cookies
      • Add an optional cookie or package of cookies that can be turned off for the site
      • Using separate functions On Accept or for On Revoke the cookies can be customised to be disable or enabled.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_cookie_control-9.6.1.tar.gz (25.8 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page