Skip to main content

Per URL api-key control for Django

Project description

Per URL api-key control for Django

Installation

To get the latest stable release from PyPi

pip install django-api-key

To get the latest commit from GitHub

pip install -e git+git://github.com/dryice/django-api-key.git#egg=django_api_key

Add django_api_key to your INSTALLED_APPS

INSTALLED_APPS = (
    ...,
    'django_api_key',
)

Migrate your database

./manage.py migrate django_api_key

Add the django_api_key URLs to your MIDDLEWARE

MIDDLEWARE = [
    ...,
    'django_api_key.middleware.APIKeyMiddleware',
]

(Optional) adjust the URLs that you don’t want api_key check. Default is:

IGNORE_API_KEY_CHECK_FOR = ["/admin/.*", "/docs/.*"]

Visit /admin/django_api_key/ipaccess/ and add rules accordingly

Usage

TODO:

Contribute

If you want to contribute to this project, please perform the following steps

# Fork this repository
# Clone your fork
mkvirtualenv -p python3.7 django-api-key
make develop

git co -b feature_branch master
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch

In order to run the tests, simply execute tox. This will install two new environments (for Django 2.0 and Django 2.1) and run the tests against both environments.

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

django-api-key-0.1.0.tar.gz (9.6 kB view hashes)

Uploaded Source

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