--- id: dj-rest-auth version: "7.2.0" license: MIT license_treatment: permissive maintenance: active --- # dj-rest-auth — Authentication and Registration in Django Rest Framework License: permissive · Maintenance: active · Downloads: 815.5K/mo ## 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 above — 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 pip install dj-rest-auth uv add dj-rest-auth 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_current - Install friction: high - Maintenance: active - Downloads: 815.5K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django rest framework authentication, django login logout api endpoints, django user registration api, django password reset rest api, django jwt authentication, django mfa totp, django rest auth, django-rest-framework, authentication, jwt-auth [View on SkillFed](https://skillfed.io/packages/dj-rest-auth) · [View on PyPI](https://pypi.org/project/dj-rest-auth/)