Framework · Install guide
Cookie consent for Django
Updated
Add Kiescy to the <head> of your base template so every page that extends it gets the banner.
- Setup time
- About 10 minutes
- Coding
- One line in your layout
- Laws covered
- GDPR, UK GDPR, CCPA, DPDP
- Google Consent Mode v2
- Built in, basic or advanced
Set up cookie consent on Django in 3 steps
- Create a free accountAdd your website. Kiescy scans it and finds the trackers that need consent.
- Paste one script into DjangoYour banner appears and starts holding back trackers until visitors choose.
- Check it worksOpen your site in a private window and run the free check to confirm nothing loads early.
Why Django sites need cookie consent
Django sites set essential session and CSRF cookies and often add Google Analytics or marketing tools. The essential cookies don't need consent; the rest do.
Your options on Django
| Approach | Good for | Watch out for |
|---|---|---|
| django-cookie-consent | Server-side cookie groups | You design the banner and regional logic |
| Kiescy in base.html | Any Django site | Template change only |
Add your privacy policy
Put the embed where your privacy policy should appear, or link straight to your hosted policy URL from the footer:
<div data-kiescy-doc="privacy"></div>
<script src="https://script.kiescy.com/embed/policy/YOUR_SITE_KEY.js" async></script>Check that it works
Open your site in a private window: the banner should appear for a first-time visitor. Then run the free privacy check, which opens your site as a new EU visitor and lists anything that still loads before consent.
Kiescy's monitoring repeats that check on a schedule and emails you if a new script starts tracking before consent.
What your Django visitors see
Kiescy detects where each visitor is and shows the version their law requires, so you don't have to choose between the strictest banner for everyone and no banner at all.
Trackers Django sites usually load
These are the tools that most often need consent on Django sites, and how Kiescy treats them. Run a cookie scan to see exactly what yours loads.
| Tool | Category | What happens |
|---|---|---|
| Google Analytics | Analytics | Consent Mode signals |
| Sentry with session replay | Analytics | Gate replay on consent |
Google Consent Mode v2 on Django
Kiescy at the top of base.html sets Consent Mode v2 defaults before any Google tag in your templates.
New to Consent Mode? Read basic vs advanced Consent Mode v2.
Troubleshooting
Some pages don't show the banner
Those templates don't extend base.html. Add the script to their own head or make them extend it.
Compliance checklist for Django
- A consent banner that blocks non-essential trackers until the visitor agrees (opt-in for the EU, UK and India).
- A "Do Not Sell or Share" option for California visitors, and Global Privacy Control honored.
- A privacy policy that names the tools above, linked from every page.
- A cookie policy listing the cookies your scan finds.
- A way for people to request, correct or delete their data.
- Records of each consent choice, kept as proof.
- Privacy policy linked in your base template footer.
Guides for Django site owners
Questions
Will it conflict with Django's CSP middleware?
Add the Kiescy API origin to script-src and connect-src in your CSP settings.
Does it work with Wagtail?
Yes. Wagtail uses Django templates; add the script to your base template.
Official Django documentation
Menus move. If a step above doesn't match what you see, Django's own docs show the current way to add code.
Get compliant this afternoon, not this quarter.
Set up your policies, banner and request form in one place. Free while Kiescy is in early access.