skip to navigation
skip to content

django-cookie-law 1.0.13

Helps your Django project comply with EU cookie law regulations

django-cookie-law helps your Django project comply with the EU cookie regulations. by displaying a cookie information banner until it is dismissed by the user.


The app can be incompatible with your local cookie law regulations. Consult your lawyer when in doubt.

Contributions and comments are welcome using Github at:

Please note that django-cookie-law requires:

  • Django >= 1.2
  • django-classy-tags >= 0.3.0


  1. pip install django-cookie-law

  2. Add 'cookielaw' to INSTALLED_APPS

  3. Run collectstatic (Django 1.3+) or copy the statics to your media directory

  4. Add cookielaw/js/cookielaw.js to the markup directly or via your asset manager such as django-pipeline or django-compressor

  5. Enable 'django.core.context_processors.request' in your TEMPLATE_CONTEXT_PROCESSORS setting, eg.:



    If you don’t have this setting defined, just add it to your settings module.

  6. {% load cookielaw_tags %} and add {% cookielaw_banner %} template tag where you want to display the cookielaw banner. Best place for this is your ‘base’ template, so you will have the cookie banner on every page of your website.


If you want to use our default template, add cookielaw/css/cookielaw.css to the markup and you should see the cookie law banner at the top of the page until you dismiss it with the button in the top-right. This CSS is Twitter Bootstrap compatible, but chances are, you’ll like to adjust it anyway.

To change the markup, just add a template named cookielaw/banner.html and make sure it is loaded before the default template (for example put the django.template.loaders.filesystem.Loader before django.template.loaders.app_directories.Loader and add your new template to any of the TEMPLATE_DIRS).

To change the CSS, just write your own rules and don’t include the default stylesheet.


  • 1.0.12 added German translation thanks to dated
  • 1.0.11 added Catalan translation thanks to joansv
  • 1.0.9 added unofficial support for Django 1.10 thanks to farin
  • 1.0.8 added Spanish translation thanks to jonashagstedt
  • 1.0.7 added Russian translation thanks to paschembri
  • 1.0.6 django.core.context_processors.request is still required but if not available in template context a warning will be raise instead of a KeyError
  • 1.0.5 added Dutch translation thanks to douwevandermeij
  • 1.0.4 context_instance is now passed to the banner template
  • 1.0.3 added Italian translation thanks to Jiloc

Some very minor changes have not been listed.

Bugs & Contribution

Please use Github to report bugs, feature requests and submit your code:

author:Piotr Kilczuk
File Type Py Version Uploaded on Size
django-cookie-law-1.0.13.tar.gz (md5) Source 2016-12-23 11KB