skillfed

dj-rest-auth

Authentication and Registration in Django Rest Framework

dj-rest-auth v7.2.0 815.5K downloads/30d#4,990 on PyPI1,866
Permissive license MIT Active released

What it is and what it does

dj-rest-auth is a Django REST Framework library that exposes standard authentication workflows as HTTP endpoints, eliminating the need to build login, logout, registration, and password reset flows from scratch. It integrates with Django's built-in authentication system and provides endpoints like /auth/login/, /auth/logout/, /auth/password/reset/, and user detail endpoints that return JSON responses suitable for single-page applications and mobile clients.

The package supports multiple authentication strategies: token-based auth, JWT with HTTP-only cookies, and optional social authentication via django-allauth. It also includes an opt-in MFA sub-package with TOTP and recovery codes. Because it depends on both Django and djangorestframework, it is intended for projects already using Django REST Framework; it is not a standalone authentication service.

Use it for:

  • Build a REST API for a React or Vue SPA that needs login, logout, and user profile endpoints without writing custom auth views
  • Add user registration with email verification to a Django REST API without implementing the workflow manually
  • Implement JWT-based authentication with secure HTTP-only cookies in a mobile app backend
  • Add multi-factor authentication (TOTP) to an existing Django REST API with minimal configuration
  • Enable social login (Google, GitHub, Facebook) in a REST API using django-allauth integration

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides drop-in REST API endpoints for user authentication, registration, password management, and multi-factor authentication in Django REST Framework applications.

Yes, if you are building a Django REST Framework API and need standard authentication endpoints. The package is actively maintained, has no known vulnerabilities, and eliminates significant boilerplate. High install friction is offset by the time saved on auth implementation. Not suitable if you are not already using Django and djangorestframework.

Install

dj-rest-auth on PyPI

pip

pip install dj-rest-auth

uv

uv add dj-rest-auth

poetry

poetry add dj-rest-auth

Installing dj-rest-auth

Before you install

High install friction due to two required runtime dependencies (Django and djangorestframework). Package is actively maintained with recent commits and no known vulnerabilities, but setup requires integrating into an existing Django project and configuring multiple settings.

License in practice

MIT license is permissive and imposes no restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install dj-rest-auth djangorestframework

# settings.py
INSTALLED_APPS = [
    'rest_framework',
    'rest_framework.authtoken',
    'dj_rest_auth',
]

# urls.py
from django.urls import path, include
urlpatterns = [
    path('auth/', include('dj_rest_auth.urls')),
]

# Now POST to /auth/login/ with {"username": "...", "password": "..."}

Requires an existing Django project with djangorestframework installed and configured; Django database migrations must be run after adding dj_rest_auth to INSTALLED_APPS.

Verify before relying

  • Whether social authentication (Google, GitHub, Facebook) requires additional setup beyond the 'with-social' extra
  • Performance characteristics under high concurrent authentication load
  • Compatibility with specific versions of Django and djangorestframework beyond the minimum Python 3.10 requirement

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction high — source build required
Runtime dependencies 2 — Django, djangorestframework
Maintenance actively maintained — 152 days since the last release
Last repo commit
First released
Downloads 815,464/month — #4,990 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dj_rest_auth-7.2.0.tar.gz

Keywords: django, rest, auth, registration, rest-framework, django-registration, api

Framework :: DjangoIntended Audience :: DevelopersIntended Audience :: System AdministratorsOperating System :: OS IndependentTopic :: Software Development

Tags

django rest framework authenticationdjango login logout api endpointsdjango user registration apidjango password reset rest apidjango jwt authenticationdjango mfa totpdjango rest auth
django-rest-frameworkauthenticationjwt-auth

More Software Development packages