dmr-from-dj-rest-auth

Migrate dj-rest-auth APIs to django-modern-rest with allauth headless account flows.

1.4k|181|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/wemake-services/django-modern-rest --skill dmr-from-dj-rest-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dmr-from-dj-rest-auth
Source: https://github.com/wemake-services/django-modern-rest/tree/main/.agents/skills/dmr-from-dj-rest-auth
Command: npx skills add https://github.com/wemake-services/django-modern-rest --skill dmr-from-dj-rest-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Replacing dj-rest-auth with django-modern-rest is not a drop-in swap: endpoint paths, payloads, token transports, and custom serializer side effects all change, and silent security regressions (lost cookie flags, weakened CSRF, dropped provisioning hooks) are easy to miss. This Skill provides a structured, flow-by-flow migration plan that preserves behavior and security posture.

Core Features & Use Cases

  • Endpoint and settings mapping: Ships a reference table mapping every dj-rest-auth URL, REST_AUTH setting, serializer, and DRF auth class to its allauth headless endpoint or dmr equivalent.
  • Security-preserving migration gates: Enforces explicit decisions on auth transport (session token, header JWT, cookie JWT, opaque token), cookie flags, and CSRF before any code is written.
  • Side-effect recovery: Guides re-attaching custom serializer validation and side effects (provisioning, invites, billing) to allauth adapters and signals.
  • Use Case: A Django project using dj-rest-auth with simplejwt cookie auth needs to move to django-modern-rest; the Skill walks through wiring allauth headless, rebuilding user-details as a typed dmr controller, and updating clients and tests flow by flow.

Quick Start

Use $dmr-from-dj-rest-auth to migrate my existing dj-rest-auth installation to django-modern-rest with allauth headless.

Frequently Asked Questions about dmr-from-dj-rest-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate from dj-rest-auth to django-modern-rest?

Move account flows (login, logout, registration, password reset, MFA, social) to django-allauth headless endpoints, then rebuild project-specific endpoints like user details as dmr controllers with typed DTOs. Migrate one flow at a time, starting with login, and update clients for every path or payload change.

What replaces dj-rest-auth endpoints when using allauth headless?

dj-rest-auth endpoints map to allauth headless routes under /_allauth/{client}/v1/, for example login becomes POST /_allauth/{client}/v1/auth/login and logout becomes DELETE the session endpoint. User details has no allauth equivalent and must be rebuilt as your own dmr controller.

Can I keep the same API paths and payloads when leaving dj-rest-auth?

No, allauth headless serves its own paths and envelope format, so strict path parity is not achievable. Treat it as a coordinated frontend and backend migration; a compatibility shim re-serving old paths is possible but is a long-lived maintenance burden.

How do I keep JWT cookie authentication after migrating to django-modern-rest?

Use dmr's CookieJWTSyncAuth and re-declare cookie flags (httponly, secure, samesite, path) as NewCookie arguments and CookieSpec declarations, since REST_AUTH settings become code. dmr enforces CSRF automatically for cookie-based auth, replacing JWT_AUTH_COOKIE_USE_CSRF.

What happens to custom dj-rest-auth serializer logic during migration?

Custom validation and side effects in overridden serializers do not move automatically. Re-attach them to allauth adapters or signals (for account logic) or to your own dmr controllers (for domain logic), and add tests for each one since side effects like provisioning are easily lost.

Does django-modern-rest support simplejwt token refresh and blacklisting?

dmr provides its own VerifyToken and RefreshToken controllers to replace simplejwt's token endpoints. Refresh-token rotation and blacklisting are not automatic; use the dmr jwt blocklist app if the project relied on simplejwt's blacklisting.