django-cookie-consent
Django cookie consent application
What it is and what it does
django-cookie-consent is a Django application that handles cookie consent workflows by storing cookie definitions and user consent choices in the database, accessible through Django admin. It supports both opt-in (users must accept before cookies are set) and opt-out (cookies are set unless rejected) consent schemes, and can remove declined cookies or non-accepted cookies depending on the scheme in use.
The package logs when users accept or decline cookies, making it straightforward to track consent history. It also handles re-consent flows when new cookies are added, prompting users to make fresh choices without losing their prior decisions. The core dependencies are django and django-appconf; it requires Python 3.10 or later and is tested against modern Django versions (4.2, 5.2, 6.0).
Use it for:
- Implement GDPR-compliant cookie consent on a Django site with opt-in or opt-out workflows.
- Store and manage cookie definitions (analytics, marketing, functional) in Django admin for non-technical users.
- Log user consent decisions for audit and compliance reporting.
- Automatically re-prompt users when new cookies are added to the site.
- Remove or prevent setting of cookies that users have declined.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Django application that manages cookie consent workflows, letting site visitors accept or reject cookies through a configurable consent interface stored in Django models.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It directly solves a common compliance need (cookie consent) with a Django-native approach. Use it if you need cookie consent management in a Django project and want database-backed, admin-editable cookie definitions.
Install
django-cookie-consent on PyPI
pip
pip install django-cookie-consentuv
uv add django-cookie-consentpoetry
poetry add django-cookie-consentInstalling django-cookie-consent
Before you install
Low friction install with only two runtime dependencies (django and django-appconf). Actively maintained as of June 2026, with recent releases and a stable production status across Django 4.2 through 6.0.
License in practice
BSD-2-Clause-first-lines is a permissive license, allowing commercial and private use with minimal restrictions; you must retain the license notice in distributions.
Quickstart
pip install django-cookie-consent
# In Django settings.py, add to INSTALLED_APPS:
# 'cookie_consent',
# Then migrate:
# python manage.py migrate
# Use in template:
# {% load cookie_consent %}
# {% cookie_consent_banner %}
Requires Django 4.2 or later and Python 3.10+; django-appconf must be installed as a runtime dependency.
Verify before relying
- Whether the package includes a pre-built frontend component (JavaScript/CSS) or requires custom UI implementation.
- Specifics on how cookie removal is enforced client-side versus server-side.
- Whether logging of user consent actions includes audit-trail capabilities for compliance documentation.
Package facts
| License | BSD-2-Clause-first-lines (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — django, django-appconf |
| Maintenance | actively maintained — 191 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,958/month — #14,570 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_cookie_consent-1.0.0-py3-none-any.whl
Keywords: cookies, cookie-consent, cookie bar
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
cookiesParses and renders HTTP Cookie and Set-Cookie…
permissive · top 15,000 on PyPI
asgi-csrfASGI middleware that protects web applications…
permissive · top 15,000 on PyPI
streamlit-cookies-controllerProvides read, write, and delete operations on…
permissive · top 15,000 on PyPI
macaroonbakeryMacaroonbakery provides HTTP authentication and…
copyleft · top 5,000 on PyPI
browser-cookie3Extracts cookies from your browser's local…
copyleft · top 5,000 on PyPI
pycookiecheatExtracts and decrypts cookies from Chrome,…
permissive · top 15,000 on PyPI
django-clickWraps the click command-line library to let you…
permissive · top 15,000 on PyPI
starlette-csrfStarlette middleware that protects web…
permissive · top 15,000 on PyPI
edx-drf-extensionsProvides JWT authentication, CSRF token…
permissive · top 15,000 on PyPI
cruftcruft creates new projects from Cookiecutter…
permissive · top 15,000 on PyPI