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 near the and of 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 are fine (as long as you run collectstatic
command).
- Start the development server and visit necessary pages.
Coming up next
- Tests (front-end too!)
- automate build and push (in many ways!)
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 Distribution
Built Distribution
Close
Hashes for django-cookie_consent_gutsh-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f1a4eb0dbdd8f79e94ef7e618e8f7ca8b0fb239b2de06db619cbc2a42483722 |
|
MD5 | 20813904b127b5a08328c71b79c24878 |
|
BLAKE2b-256 | ba7e6d24db3df2be1bc1921d05648e79febe4410570a3da27656a56dc4091704 |
Close
Hashes for django_cookie_consent_gutsh-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd7b4c4e3c3813da6b28dc815fe7d18ee0333c0fb51449dc37fc5e797511d11e |
|
MD5 | ed88f77cf7696adb47df5ce26f032139 |
|
BLAKE2b-256 | 4074475c06d3a8845a5d581da493b11f5765997bcc9cdddfcca753611181294e |