Quickstart
Installation
Install django-cookie-consent from PyPI with pip (recommended):
pip install django-cookie-consent
Alternatively, you can install directly from Github:
pip install git+https://github.com/jazzband/django-cookie-consent@master#egg=django-cookie-consent
Warning
Installing from the master branch can be unstable. It is recommended to pin your installation to a specific git tag or commit.
Configuration
Add
cookie_consent
to yourINSTALLED_APPS
.Add
django.template.context_processors.request
toTEMPLATE_CONTEXT_PROCESSORS
if it is not already added.Include django-cookie-consent urls in
urls.py
from django.urls import path urlpatterns = [ ..., path("cookies/", include("cookie_consent.urls")), ..., ]
Run the
migrate
management command to update your database tables:python manage.py migrate