UNKNOWN
Project description
A simple middleware that uses the django messages framework to add a notification regarding the EU cookie directive.
If it can’t detect a cookie about cookies, sets it and displays a message.
Installation
Install from pypi.
pip install django-cookie-message
In your settings:
* Ensure the django messages framework is installed. * Add ``'cookie_message'`` to ``INSTALLED_APPS``. * Add ``'cookie_message.middleware.CookieMessageMiddleware'`` to ``MIDDLEWARE_CLASSES``.
Configuration
The message can be changed by overriding the cookies/message.py template.
The cookie can be changed by defining COOKIE_MESSAGE_KWARGS in your settings.py. The default is:
COOKIE_MESSAGE_KWARGS = { 'key': 'cookie_message', 'value': '', 'max_age': 365 * 24 * 60 * 60, # One year. 'expires': None, 'path': '/', 'domain': None, 'secure': None, 'httponly': False, }
These are the arguments sent to set_cookie().
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-cookie-message-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ec336e8236fefbf87ffc88773bc087ca3ff0715c0b9cf288b727a5980ead2a6 |
|
MD5 | 3a57e59faf1047a560b468d50a2a7e29 |
|
BLAKE2b-256 | 96c2fb3ae716392eb0cd5561ac2d5a6f6d5476c20eeb7b2fbf45af3c3a04dc16 |