Skip to main content

Cookie consent

Cookie consent is a Django app to show consent component for web-cookies.

Quick start

  1. Add "cookie_consent" in your settings.py:
    ...
    INSTALLED_APPS = [
        ...,
        "cookie_consent",
        ...,
    ]
    ...
  1. Include the url config like this:
    path("cookie_consent/", include("cookie_consent.urls")),
  1. Run python manage.py migrate cookie_consent to create the models.
  2. Include consent template in your web-site templates.

For example, I've included the following near the end of my base template:

{% block cookie_consent %}
  <link rel="stylesheet" href="{% static 'cookie_consent/css/index.css' %}">
  {% include 'cookie_consent/includes/consent.html' with consent_text='We use cookies to understand your interactions with this web-site.' %}
  {# the default for `consent_text` is 'We are using cookies to make this website fully functional.' #}
  <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).

  1. Start the development server and visit necessary pages.

Coming up next

  • Automated testing

Metadata

Release files for django-cookie-consent-gutsh 1.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-cookie-consent-gutsh 1.1.7
File Size Uploaded Provenance
django_cookie_consent_gutsh-1.1.7.tar.gz 7.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-cookie-consent-gutsh 1.1.7
File Interpreter ABI Platform
django_cookie_consent_gutsh-1.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 kB

Security for django-cookie-consent-gutsh 1.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page