Git Product home page Git Product logo

django-gdpr-cookie-consent-demo-project's Introduction

Django GDPR Cookie Consent Demo Project

Description

This project shows an example of Django GDPR Cookie Consent app integration into a Django project.

As stated by GDPR cookie law, websites that serve content for people from European Union must get consent from website visitors before storing any cookies that are not strictly necessary for the website to function. Not complying with GDPR laws can result in a fine of up to โ‚ฌ20 million or 4% of the company's annual revenue, whichever is greater.

Django GDPR Cookie Consent app allows you to set up a modal dialog for cookie explanations and preferences. When a specific cookie section is accepted, the widget loads or renders HTML snippets related to that section. For example, if a visitor approved Performance cookies, they would get Google Analytics loaded.

Using the Django GDPR Cookie Consent app, you store the following information about the cookies in Django project settings:

  • What are the cookie sections (e.g. "Essential", "Functionality", "Performance", "Marketing")? Are they bounded with any conditional HTML snippets?
  • What are the cookie providers within each section (e.g., "This website," "Google Analytics," "Facebook," "Youtube," etc.)?
  • What are the cookies set by each of those providers?

Descriptions for sections, providers, or cookies are translatable. User preferences are saved in a cookie too. If a particular section is unselected later, cookies related to that section are attempted to get deleted.

Demo

Using Django GDPR Cookie Consent

This video was made using the Selenium tests that are included in this project's code.

Django GDPR Cookie Consent in Production

Django GDPR Cookie Consent is used at

How to Install this Demo Project

1. Create and activate a virtual environment

$ python3 -m venv venv
$ source venv/bin/activate

2. Purchase and download Django GDPR Cookie Consent app

Get Django GDPR Cookie Consent from Gumroad.

Put the *.whl file into private_wheels/ directory.

3. Download appropriate Webdriver for your Chrome version

Download and install Chrome browser.

Then download the webdriver matching your Chrome version and extract it to drivers/ directory.

4. Install pip requirements into your virtual environment

With the virtual environment activated, install pip requirements:

(venv)$ pip install -r requirements.txt

5. Run database migrations and collect static files

With the virtual environment activated, run database migrations:

(venv)$ python manage.py migrate
(venv)$ python manage.py collectstatic --noinput

6. Run Selenium tests

With the virtual environment activated, run the tests:

(venv)$ python manage.py test

7. Browse

With the virtual environment activated, run development server:

(venv)$ python manage.py runserver

Browse the local website under http://127.0.0.1:8000 and inspect the cookies in web development tools.

Compare the functionality with the source code.

8. Play around

Check the docs and try to modify the functionality.

Disclaimer

The actual website's compliance with the GDRP Cookie Law depends on the configuration of each use case. The Django GDPR Cookie Consent app provides the mechanism to make that possible, but it's up to you how you configure and integrate it.

Contact

For technical questions or bug reports, please contact Aidas Bendoraitis at https://www.djangotricks.com/feedback/.

django-gdpr-cookie-consent-demo-project's People

Contributors

archatas avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.