Skip to main content

entirius-django-accounts

A Django module for customer accounts in Entirius, the open-source modular ecommerce platform: registration, JWT login, address book and wishlist. It serves a channel-scoped public API for the storefront and a read-only admin API for the CMS.

PyPI Python License: MPL-2.0

What it does

  • Registers customers with double opt-in email confirmation and a configurable password policy.
  • Logs customers in with JWT access and refresh tokens, including logout and password reset.
  • Keeps an address book with billing and shipping defaults and file attachments in private storage.
  • Stores one wishlist per customer and sales channel, and merges a guest wishlist on login.
  • Supports social login with Google and Facebook.
  • Imports accounts and addresses from CSV, and deletes a customer on request through an admin endpoint.

Installation

uv add entirius-django-accounts
pip install entirius-django-accounts

Extras: entirius-django-accounts[pim] adds the product-representation sync from entirius-django-pim.

INSTALLED_APPS = [
    ...
    "allauth",
    "allauth.account",
    "allauth.socialaccount",
    "django_regional",
    "django_utils",
    "django_email",
    "django_accounts",
]

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

JWT_SECRET = "<random secret>"
PRIVATE_DIR = "/private"            # root of private file storage
MIGRATION_0023_MECHANISM = 1        # wishlist restructuring mode; 1 on a fresh installation

JWT_SECRET, PRIVATE_DIR and MIGRATION_0023_MECHANISM are read at import time and the module refuses to start without them. Settings reference: https://github.com/entirius/entirius-django-accounts/blob/develop/docs/configuration.md

Register the JWT backend, or every customer endpoint behind @authenticate (customer/me/, profile, addresses, wishlist, password change, logout) answers 401 even with a valid token:

AUTHENTICATION_BACKENDS = [
    "django_accounts.backends.JWTAccessBackend",
    "django.contrib.auth.backends.ModelBackend",  # Django admin login
]

The customer-delete admin endpoint takes a key. Where entirius-django-access is installed (the backend service installs it when available) the key is an access token:

python manage.py access_token create --application <name> --create-application --scope accounts.erase --channel <idx>

Only without django_access the key comes from the module's own command:

python manage.py generate-api-admin-key <channel_idx>

Quick start

from django_accounts.services.admin_service import list_customers

verified = list_customers(search="example.com", is_verified=True, ordering="-created_at")

Requirements

  • Python 3.11 or newer, Django 4.0 or newer.
  • PostgreSQL (the test suite runs on it through DATABASE_URL).
  • django-allauth, Django REST Framework, djangorestframework-simplejwt, marshmallow, pydantic, drf-spectacular.
  • Entirius packages pulled in: entirius-django-email, entirius-django-regional, entirius-django-utils, entirius-py-process-logger, entirius-py-idx-normalizator, entirius-py-int-enum-choices.
  • Optional: entirius-django-pim (the pim extra), entirius-django-access (keys as access tokens).

Documentation

Part of Entirius

This module runs inside the Entirius backend service (Volkanos) and owns customer identity for the storefront.

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-accounts/blob/develop/AGENTS.md

License

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

Metadata

Release files for entirius-django-accounts 6.0.0

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-accounts 6.0.0
File Size Uploaded
entirius_django_accounts-6.0.0.tar.gz 202.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entirius-django-accounts 6.0.0
File Interpreter ABI Platform
entirius_django_accounts-6.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 283.4 kB

Release files / entirius_django_accounts-6.0.0.tar.gz

Download URL entirius_django_accounts-6.0.0.tar.gz
Size 202.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b4cdff1e46c397ca4e228d0dceb1c9d340d7e4b72188ee7f1e03563b37bab6ef
BLAKE2b-256 checksum
How to use checksums
4c8867698bde94c70de73c270c6987d998fe7a5adcad7b4cc1d4240bada4a159
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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_accounts-6.0.0-py3-none-any.whl

Download URL entirius_django_accounts-6.0.0-py3-none-any.whl
Size 80.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41af844964f638cbc910c82a469960ac1995595d0f4777ce8dadcea06f780ca3
BLAKE2b-256 checksum
How to use checksums
9a51f9e1d76d607ce9d69dd017326b7548adbcc5b713f9825da6c704c0178420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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 history Release notifications | RSS feed

This release

6.0.0 This release

2 release files

5.0.1

2 release files

5.0.0

2 release files

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