skillfed

django-cookie-consent

Django cookie consent application

django-cookie-consent v1.0.0 77.0K downloads/30d#14,570 on PyPI269
Permissive license BSD-2-Clause-first-lines Active released

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-consent

uv

uv add django-cookie-consent

poetry

poetry add django-cookie-consent

Installing 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

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: UnixProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules

Tags

django cookie consentcookie consent managementgdpr cookie banneropt-in opt-out cookiedjango cookie barcookie acceptance trackingcookie compliance django
compliancecookie-managementgdpr

More Python Modules packages