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.
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
- Module docs: https://github.com/entirius/entirius-django-agreements/tree/develop/docs
- Entirius documentation: https://docs.entirius.com/
- Changelog: https://github.com/entirius/entirius-django-agreements/blob/develop/CHANGELOG.md
Part of Entirius
This module runs inside the Entirius backend service (Volkanos); the leads module builds on its legal bases and consents.
- Backend service: https://github.com/entirius/entirius-service-volkanos
- Docker harness: https://github.com/entirius/entirius-zeno
- Sibling modules: https://github.com/entirius/entirius-django-regional, https://github.com/entirius/entirius-django-leads, https://github.com/entirius/entirius-django-access
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.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| entirius_django_agreements-3.1.0.tar.gz | 195.6 kB | Without provenance | Details for entirius_django_agreements-3.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| entirius_django_agreements-3.1.0-py3-none-any.whl | Python 3 | none | any | Details for entirius_django_agreements-3.1.0-py3-none-any.whl |
Total release size: 323.9 kB
Release files / entirius_django_agreements-3.1.0.tar.gz
| Download URL | entirius_django_agreements-3.1.0.tar.gz |
|---|---|
| Size | 195.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57008a55300aef743b4c82505e0c225052503d5e894429eb55eabc9161b888c3
|
|
BLAKE2b-256 checksum How to use checksums |
5df05e8d3e6978b48ab9e4ddd423842ab4f4148a3e487a3adbf1226aee8f2801
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.1.0-py3-none-any.whl
| Download URL | entirius_django_agreements-3.1.0-py3-none-any.whl |
|---|---|
| Size | 128.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6e4d24b526fcd76e7bc53269ae11b68ef504b2eb06315718688c8b65d5daab6
|
|
BLAKE2b-256 checksum How to use checksums |
01ed36cdb63ea56bc5277be5ec0e767e32c86cecee6740d737f882ec8fc28354
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.1.0
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.