django-ninja-jwt
Django Ninja JWT - JSON Web Token for Django-Ninja
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and fills a clear gap for Django-Ninja users who need JWT authentication without Django REST Framework. The permissive MIT license poses no restriction. Install if you are building a Django-Ninja API that requires token-based authentication.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django >= 2.1, Django-Ninja >= 0.16.1, and django-ninja-extra >= 0.14.2; must use NinjaExtraAPI rather than plain Django-Ninja Router for default controller registration.
- Low install friction with a pure-Python wheel distribution.
- Actively maintained as of 24 days ago with recent commits and a stable dependency chain anchored on Django and pyjwt.
License · maintenance · safety
permissive license (permissive) — MIT-licensed under permissive terms, allowing unrestricted use, modification, and distribution in commercial and private projects.
last release 2026-07-21 (24 days) · last repo commit 2026-08-01 · 237 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 237,436 downloads/mo, #8,959 on PyPI
Alternatives
Verify before relying
pip install django-ninja-jwt
from django_ninja_jwt.controller import NinjaJWTDefaultController
from django_ninja_extra import NinjaExtraAPI
api = NinjaExtraAPI()
api.register_controllers(NinjaJWTDefaultController)- Whether token claims customization covers all common use cases (user roles, permissions, custom fields).
- Performance characteristics under high token generation or validation load.
- Compatibility with async Django views and whether refresh/verify endpoints support async handlers.
What it is and what it does
Django-Ninja-JWT is a JWT authentication plugin for Django-Ninja that provides token-based authentication without the Django REST Framework dependency. It is a fork of Simple JWT adapted to work with Django-Ninja's native API framework, offering three core endpoints: token pair generation (access and refresh tokens), token refresh, and token verification. The library handles the cryptographic signing and validation of JWTs using pyjwt, and integrates with Django's user authentication system.
You register a controller to your NinjaExtraAPI instance to expose these endpoints, then use the returned access tokens in Authorization headers to protect views. Refresh tokens allow clients to obtain new access tokens without re-authenticating. The package supports customization by subclassing its controller classes, and can be localized by adding it to INSTALLED_APPS. It maintains compatibility with modern Python versions and recent Django releases.
Use it for
- Build stateless REST APIs with Django-Ninja that issue short-lived access tokens and longer-lived refresh tokens for client authentication.
- Protect Django-Ninja endpoints by requiring Bearer token validation without adding Django REST Framework to your project.
- Implement token refresh workflows where clients exchange expired access tokens for new ones using a refresh token.
- Customize token claims and validation logic by subclassing controller classes for domain-specific requirements.
- Add JWT support to existing Django-Ninja projects that need standard token-based authentication.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and fills a clear gap for Django-Ninja users who need JWT authentication without Django REST Framework. The permissive MIT license poses no restriction. Install if you are building a Django-Ninja API that requires token-based authentication.
Install
django-ninja-jwt on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained as of 24 days ago with recent commits and a stable dependency chain anchored on Django and pyjwt.
Requires Django >= 2.1, Django-Ninja >= 0.16.1, and django-ninja-extra >= 0.14.2; must use NinjaExtraAPI rather than plain Django-Ninja Router for default controller registration.
License in practice
MIT-licensed under permissive terms, allowing unrestricted use, modification, and distribution in commercial and private projects.
Quickstart
pip install django-ninja-jwt
from django_ninja_jwt.controller import NinjaJWTDefaultController
from django_ninja_extra import NinjaExtraAPI
api = NinjaExtraAPI()
api.register_controllers(NinjaJWTDefaultController)
Verify before relying
- Whether token claims customization covers all common use cases (user roles, permissions, custom fields).
- Performance characteristics under high token generation or validation load.
- Compatibility with async Django views and whether refresh/verify endpoints support async handlers.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesDjangopyjwtpydantic-settingsdjango-ninja-extra |
| Maintenance | Actively maintained 24 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 237,436 / month, #8,959 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentFramework :: AsyncIOFramework :: DjangoFramework :: Django :: 3.1Framework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Intended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: django_ninja_jwt-5.4.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “jwt authentication django ninja”
- django-ninja-jwtProvides JWT authentication for Django-Ninja APIs, offering token…
- edx-drf-extensionsProvides JWT authentication, CSRF token endpoints, and cross-cutting…
- djangorestframework-jwtAdds JSON Web Token (JWT) authentication support to Django REST…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also django-ninja-extra · djangorestframework-simplejwt · django-ninja · Flask-JWT-Extended · drf-jwt · dj-rest-auth · zi-api-auth-client · myjwt · django-graphql-jwt · djangorestframework-jwt