Cookie consent component for any Django web-site
Project description
Cookie consent
Cookie consent is a Django app to show consent component for web-cookies.
Quick start
- Add "cookie_consent" to your
INSTALLED_APPS
setting like this:
INSTALLED_APPS = [
"cookie_consent",
...,
]
- Include the cookie_consent URLconf in your project urls.py like this:
path("cookie_consent/", include("cookie_consent.urls")),
- Run
python manage.py migrate
to create the models. - Include consent template in your web-site templates.
For example, I've included that text in my base template:
{% block cookie_consent %}
<link rel="stylesheet" href="{% static 'cookie_consent/css/index.css' %}">
{% include 'cookie_consent/includes/consent.html' %}
<script defer src="{% static 'cookie_consent/js/main.js' %}"></script>
{% endblock %}
Don't forget to serve that script and css files! You can find them in distribution, css and js are in both source and compiled forms and is are fine (as long as you run collectstatic
command).
- Start the development server and visit necessary pages.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for django_cookie_consent_gutsh-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff3984b8791f2f9b532d7ea1939ec6f0a85a9c77524ebd145186ed894307fe8 |
|
MD5 | 25d905d5d4d67613a62c3fcafd1d2282 |
|
BLAKE2b-256 | f17adfb24f09ad89dbfc9b967be71ae245195b92adb1d44a61ffdd0f66806a5c |