Skip to main content

Django specific cookie implementation compliant with Dutch law, use at your own risk.

Project description

Updating

From 0.1.6 to 0.2

The model has changed, run South migrations. Multilingual support has been added. Optional title and close fields added.

From 0.1.4 to 0.1.5

If you’re updating from 0.1.4 to 0.1.5 take note that the CookieBar model has changed, you should run the South migrations.

Requirements

  • jQuery

Usage

  • Add the cookie_law app to your INSTALLED_APPS.
  • Add ‘url(r’^cookies/’, include(‘cookie_law.urls’)),’ to your main urls.py, without the ‘’.
  • Run the cookie_law migrations or syncdb if you don’t use South, but you should.
  • Load the cookie_bar template tags and include {% show_cookie_bar %} under the <body> tag in your base template.
  • Create a cookie bar in the admin (if you do not a default bar will be created, you should edit this asap).
  • Surround your cookies with {% if request.COOKIES.allow_cookies == ‘1’ %} <cookie> {% endif %}

Multilingual Support

If you want multilingual support add the languages you want to your settings file. LANGUAGES = ((‘nl’,’Nederlands’), (‘en’,’English’)) Every time the cookie bar template tag is called it will check if a cookie bar exists for each language, if not; one will be created. It is up to you to translate these into the right language. You can do this via the admin.

The multilingual support works by checking for a LANGUAGE_CODE in the request. Localization middleware should handle this. If this doesn’t exist the default Dutch cookie bar will be used.

Project details


Release history Release notifications

History Node

0.2.1

This version
History Node

0.2

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-cookie-law-nl-0.2.tar.gz (8.2 kB) Copy SHA256 hash SHA256 Source None Dec 10, 2012

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page