djangorestframework-simplejwt
A minimal JSON Web Token authentication plugin for Django REST Framework
What it is and what it does
Simple JWT is a minimal authentication plugin that adds JSON Web Token support to Django REST Framework. It sits between your DRF views and incoming requests, validating bearer tokens in the Authorization header and attaching the authenticated user to the request object. The package handles token issuance on login and validation on each request, integrating directly into DRF's authentication and permission system.
It depends on django, djangorestframework, and pyjwt to handle the cryptographic signing and verification. The package is designed for stateless API authentication—tokens are self-contained and don't require server-side session storage. Once configured, protected views work like any other DRF permission class.
Use it for:
- Secure a REST API with token-based authentication that doesn't require server-side session storage.
- Authenticate microservices or third-party integrations using bearer tokens in the Authorization header.
- Add JWT authentication to an existing Django REST Framework project with minimal configuration.
- Build stateless authentication for horizontally scaled API servers without shared session backends.
- Integrate token-based auth into mobile or SPA clients that need to authenticate with a Django API.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides JSON Web Token (JWT) authentication for Django REST Framework applications, handling token generation, validation, and request authentication.
Yes. This is a production-stable, actively maintained package with no known vulnerabilities, low install friction, and a permissive MIT license. It is the standard JWT authentication choice for Django REST Framework and is widely used in the ecosystem. Install it if you need token-based authentication for a DRF API.
Install
djangorestframework-simplejwt on PyPI
pip
pip install djangorestframework-simplejwtuv
uv add djangorestframework-simplejwtpoetry
poetry add djangorestframework-simplejwtInstalling djangorestframework-simplejwt
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and a stable production status across Django 4.2 through 5.2 and Python 3.9–3.13.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely as long as you include the original license notice.
Quickstart
pip install djangorestframework-simplejwt
from djangorestframework_simplejwt.views import TokenObtainPairView
from djangorestframework_simplejwt.authentication import JWTAuthentication
# In urls.py: path('api/token/', TokenObtainPairView.as_view())
# In views: authentication_classes = [JWTAuthentication]
Requires django and djangorestframework to be installed and configured; assumes a working DRF project structure.
Verify before relying
- Whether token refresh and expiration strategies are configurable for different security requirements.
- Support for custom claim serialization or non-standard JWT payloads beyond the documented defaults.
- Specific implementation details of the token lifecycle and refresh flow.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — django, djangorestframework, pyjwt |
| Maintenance | actively maintained — 389 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,316,327/month — #1,635 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: djangorestframework_simplejwt-5.5.1-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
django-ninja-jwtProvides JWT authentication for Django-Ninja…
permissive · top 15,000 on PyPI
drf-jwtAdds JSON Web Token (JWT) authentication to…
permissive · top 15,000 on PyPI
djangorestframework-jwtAdds JSON Web Token (JWT) authentication…
permissive · top 15,000 on PyPI
djangorestframework-api-keyProvides API key authentication and permission…
permissive · top 5,000 on PyPI
djoserProvides Django REST Framework views for user…
permissive · top 15,000 on PyPI
django-sesamedjango-sesame provides token-based…
permissive · top 15,000 on PyPI
django-graphql-jwtAdds JSON Web Token (JWT) authentication to…
permissive · top 15,000 on PyPI
django-rest-knoxProvides token-based authentication for Django…
permissive · top 5,000 on PyPI
edx-drf-extensionsProvides JWT authentication, CSRF token…
permissive · top 15,000 on PyPI
dj-rest-authProvides drop-in REST API endpoints for user…
permissive · top 5,000 on PyPI