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. Set STOREFRONT_BASE_URL in every environment anyway: the newsletter mails link to it, and the agreements.storefront_url health check warns while it is unset. 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.2.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.2.1
File Size Uploaded Provenance Actions
entirius_django_agreements-3.2.1.tar.gz 202.2 kB Without provenance Details for entirius_django_agreements-3.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 335.9 kB

Release files / entirius_django_agreements-3.2.1.tar.gz

Download URL entirius_django_agreements-3.2.1.tar.gz
Size 202.2 kB
Tags Source
SHA-256 checksum
How to use checksums
70a26bbb954bfb4c3330b115a068de478c024a8fcb72adc4d8fecd9f108499e0
BLAKE2b-256 checksum
How to use checksums
daf01d15fa695bdd0cd423df265660135b9c119657f056e90263502db1a0e35b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2.1-py3-none-any.whl

Download URL entirius_django_agreements-3.2.1-py3-none-any.whl
Size 133.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40d0aa077dd5f768ad8459ac8e4141de227758a3a102ea961ec8b6531c4f524b
BLAKE2b-256 checksum
How to use checksums
c0c06b9b8f2fa98b7ffd35d99350830c00cbe8584c0c9ca343638bd0482763b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.2.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