You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

django-cookie-consent-gutsh

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-cookie-consent-gutsh

Cookie consent component for any Django web-site

1.1.7
pipPyPI
Maintainers
1

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

Quick start

  • Add "cookie_consent" in your settings.py:
    ...
    INSTALLED_APPS = [
        ...,
        "cookie_consent",
        ...,
    ]
    ...
  • Include the url config like this:
    path("cookie_consent/", include("cookie_consent.urls")),
  • Run python manage.py migrate cookie_consent to create the models.
  • 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).

  • Start the development server and visit necessary pages.

Coming up next

  • Automated testing

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.