Skip to main content

API key permissions for the Django REST Framework

Project description

djangorestframework-api-key

API key permissions for the Django REST Framework.

python versions django versions drf versions

Introduction

djangorestframework-api-key is a powerful library for allowing server-side clients to safely use your API. These clients are typically third-party backends and services (i.e. machines) which do not have a user account but still need to interact with your API in a secure way.

Features

  • ✌️ Simple to use: create, view and revoke API keys via the admin site, or use built-in helpers to create API keys programmatically.
  • 🔒 As secure as possible: API keys are treated with the same level of care than user passwords. They are hashed using the default password hasher before being stored in the database, and only visible at creation.
  • 🎨 Customizable: satisfy specific business requirements by building your own customized API key models, permission classes and admin panels.

Example use cases

  • Using the built-in APIKey model, you can generate an API key and embed it in your frontend app server so that only it can access your API.
  • By customizing API key models and permissions, you can associate API keys to an entity (e.g. a user, person, organization…), and then build endpoints to allow them to manage their API keys.

Quickstart

Install the latest version with pip:

pip install djangorestframework-api-key

Add the app to your INSTALLED_APPS:

# settings.py

INSTALLED_APPS = [
  # ...
  "rest_framework",
  "rest_framework_api_key",
]

Run the included migrations:

python manage.py migrate

To learn how to configure permissions and manage API keys, head to the Documentation.

Changelog

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangorestframework-api-key-1.3.0b0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file djangorestframework-api-key-1.3.0b0.tar.gz.

File metadata

  • Download URL: djangorestframework-api-key-1.3.0b0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for djangorestframework-api-key-1.3.0b0.tar.gz
Algorithm Hash digest
SHA256 97bce551a0400ae37f23d5e42fc3b4eb1ef15e48f33b07b1a8950f1e127c2229
MD5 fcc7b55f018eb9c65c1434a8a827c90a
BLAKE2b-256 17e7aaf662e6ccf058707f1ac1a6dea7361be3b908250b10f1a16dcf11cb8e07

See more details on using hashes here.

File details

Details for the file djangorestframework_api_key-1.3.0b0-py3-none-any.whl.

File metadata

  • Download URL: djangorestframework_api_key-1.3.0b0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for djangorestframework_api_key-1.3.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c56347a2ce63f2044dfa9eddb25b95348241fe0d41a96d5decd33c1ffed72a4
MD5 f8506c0d0c1d7e7fac836ef050124c78
BLAKE2b-256 62bcd4aab0c657208a2635992ae30d8baed99588b116d23967fe686b32488ec5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page