skillfed

djangorestframework-simplejwt

A minimal JSON Web Token authentication plugin for Django REST Framework

djangorestframework-simplejwt v5.5.1 8.3M downloads/30d#1,635 on PyPI4,330
Permissive license MIT Active released

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-simplejwt

uv

uv add djangorestframework-simplejwt

poetry

poetry add djangorestframework-simplejwt

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP

Tags

jwt authentication djangodjango rest framework token authjson web token djangodjango api authenticationbearer token django reststateless authentication djangojwt token refresh django
jwt-authstateless-auth

More WWW/HTTP packages