Skip to main content

A Django app for managing GDPR compliancy

Project description

Black

GDPR Helpers

GDPR Helpers is a Django app for easy GDPR compliance.

Quickstart

Install Django GDPR Helpers:

pip install django-gdpr-helpers

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
   ...
   'gdpr_helpers',
   ...
)

Define your reasons for asking personal data and assign them to a group:

from gdpr_helpers.models import LegalReasonGroup, egalReason

legal_group = LegalReasonGroup.objects.create(where="registration")

LegalReason.objects.create(legal_group=legal_group, flag_text="Required for registration", slug="registration", active=True, required=True)
LegalReason.objects.create(legal_group=legal_group, flag_text="Optional for registration", slug="marketing", active=True, required=False)

Or use the django-admin.

Add the Mixin to a form that create an object and need privacy flags, remember to save the PrivacyLog in someplace:

from django import forms
from gdpr_helpers.forms import GDPRFormMixin
from .models import User


class RegistrationForm(GDPRFormMixin):
   class Meta:
     model = User
     where = "registration"
     fields = ("whatever_fields_from_model",)

   def save(self):
     user = super().save()
     PrivacyLog.objects.create_log(content_object=user, cleaned_data=self.cleaned_data)
     return user

Note that the privacy fields are already injected in the form.

Filling the form will now create logs for the object created.

Features

  • Can define Legal reason for which you are collecting personal data

  • Can define duration for the consents

  • Create logs for the data you collected with a timestamp and what the user consented to

  • Logs are anonymous

Changelog

Version 0.5.0

models.PrivacyLog

  • New property is_expired: if anyof the LegalReason are expired return True.

models.LegalReasonGroup

  • New field “is_nenewable”: flag the log as renewable (duh), default to False.

models.LegalReason

  • New field “duration”: as we can’t have user consents for data processing for an indefinite period this will store how log we can use the data for this purpose, default to 365 days.

  • New field “changed_at”: this is a Django auto_now field, when a LegalReason change then we must expire the corresponding log.

  • New method check_expiration: return True if the consents is expired or the LegalReason is changed

middleware.ConsentExpiredMiddleware

  • A middleware that check PrivacyLog for a user instance (so the consents given during registration) and add some context to response if True. This is mostly as an example of how to handle consents expiration, but it can be used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-gdpr-helpers-0.5.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_gdpr_helpers-0.5.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file django-gdpr-helpers-0.5.0.tar.gz.

File metadata

  • Download URL: django-gdpr-helpers-0.5.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django-gdpr-helpers-0.5.0.tar.gz
Algorithm Hash digest
SHA256 716873124a1307208c741c3b3e8e5effbf27c7f276c9cb580f96e5fc49bef5cb
MD5 173043b32512993e7ca356375f8f55e9
BLAKE2b-256 0ad7cae5e0ec4c896410ef46bec29ca8abb951923c03f8776908194db4218305

See more details on using hashes here.

File details

Details for the file django_gdpr_helpers-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: django_gdpr_helpers-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for django_gdpr_helpers-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7aa0a4f915a30533ebadeeb32365968081e41353556c67721a850b3804289e6
MD5 3c719499b6bd15e37a777dde14402a0d
BLAKE2b-256 69fd4d0f74eab3a17f8fe82a9bc76e8c88235e3b90b8b84c3463fcfa12137e6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page