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/django-commons/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_consentto yourINSTALLED_APPS.Add
django.template.context_processors.requesttoTEMPLATE_CONTEXT_PROCESSORSif it is not already added.Include django-cookie-consent urls in
urls.pyfrom django.urls import path urlpatterns = [ ..., path("cookies/", include("cookie_consent.urls")), ..., ]
Run the
migratemanagement command to update your database tables:python manage.py migrate