Skip to main content

entirius-django-agreements

A Django module for consents and legal agreements in Entirius, the open-source modular ecommerce platform. It versions agreement texts, records every consent and objection in an append-only audit trail, and freezes the text a customer accepted with each order. The CMS manages agreements over an admin API; the storefront uses a public API.

PyPI Python License: MPL-2.0

What it does

  • Defines agreements per sales channel and keeps immutable, numbered versions of their text.
  • Records consents and withdrawals per email address as an append-only audit log.
  • Stores a snapshot of the accepted agreement texts with every order.
  • Handles newsletter signup with double opt-in confirmation links.
  • Versions legal clauses per channel, legal basis and language, and records objections.
  • Exports and pseudonymises personal data for GDPR requests.

Installation

uv add entirius-django-agreements
pip install entirius-django-agreements
INSTALLED_APPS = [
    ...
    "django_utils",
    "django_regional",
    "django_agreements",
]

# urls.py
urlpatterns = [
    path("", include("django_agreements.urls")),
]

No setting is required: every setting has a default. Reference: https://github.com/entirius/entirius-django-agreements/blob/develop/docs/configuration.md

Every public write endpoint (consent create, withdraw, newsletter subscribe, order agreements) needs a key in the X-API-KEY header or a JWT; the signed-token links (confirm, unsubscribe), the cookie consent POST and the GETs do not. Where django_access is installed the key is an access token with the scope agreements.subscribe:

python manage.py access_token create --application storefront --create-application --scope agreements.subscribe --channel default

Without django_access, the key is the value of the AGREEMENTS_API_KEY setting.

POST consents/ with a key alone (no JWT) refuses every marketing-category agreement with HTTP 400: the body email is only a claim, so marketing consent goes through newsletter subscribe (double opt-in). With a JWT it is accepted. consent_service.record_multiple_consents(..., email_verified=False) enforces this; the default is True for internal callers.

Quick start

from django_agreements.services.consent_service import get_consent_status, is_consented

is_consented("customer@example.com", "marketing-email")   # latest record for one agreement
get_consent_status("customer@example.com")                # every agreement slug -> granted

Channels are copied from the product module when it is installed:

python manage.py sync_agreement_channels

Requirements

  • Python 3.11 or newer, Django 5.0 or newer.
  • Entirius packages pulled in: entirius-django-utils, entirius-django-regional, entirius-py-process-logger.

Documentation

Part of Entirius

This module runs inside the Entirius backend service (Volkanos); the leads module builds on its legal bases and consents.

Development

make install     # sync dependencies (uv)
make check       # lint + format check (ruff)
make test        # test suite (pytest + pytest-django, needs PostgreSQL via DATABASE_URL)

Development and agent instructions: https://github.com/entirius/entirius-django-agreements/blob/develop/AGENTS.md

License

Mozilla Public License 2.0 (MPL-2.0) — see https://github.com/entirius/entirius-django-agreements/blob/develop/LICENSE.

Metadata

Release files for entirius-django-agreements 3.0.1

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

Source distribution (sdist)

Source distribution for entirius-django-agreements 3.0.1
File Size Uploaded Provenance Actions
entirius_django_agreements-3.0.1.tar.gz 194.2 kB Without provenance Details for entirius_django_agreements-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for entirius-django-agreements 3.0.1
File Interpreter ABI Platform Actions
entirius_django_agreements-3.0.1-py3-none-any.whl Python 3 none any Details for entirius_django_agreements-3.0.1-py3-none-any.whl

Total release size: 321.4 kB

Release files / entirius_django_agreements-3.0.1.tar.gz

Download URL entirius_django_agreements-3.0.1.tar.gz
Size 194.2 kB
Tags Source
SHA-256 checksum
How to use checksums
98a9c2add0e040986178f4341de208439b4529601c5bcf244c484d8a5ed0370b
BLAKE2b-256 checksum
How to use checksums
d97e94f2ddfd58f56e5d04f076bfcb3278667af536991d9cf441c9b1a60f5e85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / entirius_django_agreements-3.0.1-py3-none-any.whl

Download URL entirius_django_agreements-3.0.1-py3-none-any.whl
Size 127.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4b4f4944209084ac68b60409a4634ed75acc68d1cb439c57f32f69f1f9401bf
BLAKE2b-256 checksum
How to use checksums
ea03aac94d75f9f6e9ea03ab8d6738289d5c6721fbc1b7c8220472c695521156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for entirius-django-agreements 3.0.1

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