A Wagtail-themed template and integration pack for Hello, ID Please (HIdP), providing improved authentication, account management, and security for Wagtail-based Django projects.
- Wagtail-styled templates for HIdP authentication and account management flows.
- Middleware to enforce OTP (One-Time Password) for Wagtail admin access.
- Context processor for account management links.
- Custom admin menu item for account security.
- CSS for consistent look and feel with Wagtail.
-
Install the package (from PyPI or your local source):
pip install django-hidp-wagtail
-
Add to your
INSTALLED_APPSabovehidpin your Django settings:INSTALLED_APPS = [ # ... "hidp_wagtail", # Should be above "hidp" for templates to work "hidp", # ... ]
-
Set the Wagtail admin login URL to use HIdP:
WAGTAILADMIN_LOGIN_URL = 'hidp_accounts:login'
-
Add the context processor for account management links:
TEMPLATES = [ { # ... 'OPTIONS': { 'context_processors': [ # ... "hidp_wagtail.context_processors.account_management_links", ], }, }, ]
-
(Recommended) Add the OTP middleware to protect Wagtail admin:
MIDDLEWARE = [ # ... "hidp_wagtail.middleware.OTPRequiredForWagtailAdminMiddleware", # ... ]
- The package provides templates for both pre-login and post-login HIdP flows, styled for Wagtail.
- Account management links are available in the context for use in templates.
- The middleware
OTPRequiredForWagtailAdminMiddlewareensures only OTP-verified users with admin access can use the Wagtail admin.
- Lint and check:
make lint - Build:
make build - See Makefile for more commands.