djangorestframework-api-key
API key permissions for the Django REST Framework
Decision gist · record as of 2026-08-14
Yes, with conditions. Install this if you need simple, secure API key authentication for server-to-server or service-to-API access in a Django REST Framework project. The library has no known vulnerabilities and supports current Python and Django versions. However, maintenance is aging (last release 497 days ago), so verify the feature set meets your needs before committing. Do not use this for user authentication.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django and Django REST Framework to be installed and configured; Python 3.8 or later.
- Low install friction with a single runtime dependency (packaging).
- Maintenance status is aging—last release was 497 days ago—but the repository is active and not archived with recent commits.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute freely as long as you include the license notice.
last release 2025-04-04 (497 days) · last repo commit 2025-04-04 · 742 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,118,359 downloads/mo, #3,282 on PyPI
Alternatives
Verify before relying
pip install "djangorestframework-api-key==3.*"
# In settings.py
INSTALLED_APPS = [
"rest_framework",
"rest_framework_api_key",
]
# Run migrations
python manage.py migrate- Whether the SHA512-based key hasher is suitable for your security requirements.
- Performance impact of API key validation in your specific deployment context.
- Whether API keys alone meet your authorization needs or if OAuth would be more appropriate.
What it is and what it does
This library adds API key-based authentication to Django REST Framework APIs, allowing you to issue, manage, and validate API keys for server-side clients—typically third-party services or internal backends—that need to access your API without user accounts. Keys are hashed before storage and can be created, viewed, and revoked through Django's admin interface or programmatically.
The package is designed specifically for machine-to-machine access and blocking anonymous traffic, not for identifying individual users. It includes permission classes that integrate with DRF's permission system, support for optional expiry dates, and customizable models and admin panels. The library emphasizes security by treating API keys with the same care as passwords and recommends serving your API over HTTPS.
Use it for
- Blocking anonymous traffic to your API while allowing authenticated service-to-service requests.
- Implementing API key-based throttling to rate-limit requests from specific clients or services.
- Authorizing internal services, such as communication between your API server and an internal frontend application.
- Logging and identifying usage patterns by associating requests with specific API keys.
- Managing access for third-party backend services that need to interact with your API without user credentials.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install this if you need simple, secure API key authentication for server-to-server or service-to-API access in a Django REST Framework project. The library has no known vulnerabilities and supports current Python and Django versions. However, maintenance is aging (last release 497 days ago), so verify the feature set meets your needs before committing. Do not use this for user authentication.
Install
djangorestframework-api-key on PyPI
Before you install
Low install friction with a single runtime dependency (packaging). Maintenance status is aging—last release was 497 days ago—but the repository is active and not archived with recent commits.
Requires Django and Django REST Framework to be installed and configured; Python 3.8 or later.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute freely as long as you include the license notice.
Quickstart
pip install "djangorestframework-api-key==3.*"
# In settings.py
INSTALLED_APPS = [
"rest_framework",
"rest_framework_api_key",
]
# Run migrations
python manage.py migrate
Verify before relying
- Whether the SHA512-based key hasher is suitable for your security requirements.
- Performance impact of API key validation in your specific deployment context.
- Whether API keys alone meet your authorization needs or if OAuth would be more appropriate.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepackaging |
| Maintenance | Aging 497 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,118,359 / month, #3,282 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 2.2Framework :: Django :: 3.2Framework :: Django :: 4.2Framework :: Django :: 5.2Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules |
Evidence: djangorestframework_api_key-3.1.0-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 › “api key permissions django”
- djangorestframework-api-keyProvides API key authentication and permission control for Django…
- dry-rest-permissionsDefines rules-based permissions for Django REST Framework APIs by…
- rest_conditionProvides logical operators (And, Or, Not) to compose complex…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also django-oauth-toolkit · djangorestframework-simplejwt · djangorestframework · authzed · dry-rest-permissions · zope.security · drf-api-logger · djangorestframework-guardian · djangorestframework-types · django-guardian