Skip to main content

Simple Key authentication for Django.Based on github.com/scoursen/django-apikey

Project description

Key authentication for django. Can be used with django-piston easily.

Based on https://github.com/scoursen/django-apikey.

Installation

pip install django-apikey

Configuration

Add ‘apikey’ to your settings.py:

INSTALLED_APPS = (
...
'apikey',
....
)

You can change the authorization header by setting the APIKEY_AUTHORIZATION_HEADER in settings.py:

APIKEY_AUTHORIZATION_HEADER = 'App-Authorization'

To add api authentication with piston do thisin your handlers.

from apikey.auth import ApiKeyAuthentication
from piston.handler import BaseHandler
from piston.resource import Resource
from myapp.models import Item

class ItemHandler(BaseHandler):
    allowed = ('GET', )
    model = Item

    def read(self):
        return Item.objects.all()

handler = Resource(
    handler=ItemHandler, authentication=ApiKeyAuthentication())

Thanks

This project is base on the one of Steve Course https://github.com/scoursen/django-apikey but with several simplifications.

License

This software is licensed under the New BSD License.

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-apikey-0.1.7.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file django-apikey-0.1.7.tar.gz.

File metadata

File hashes

Hashes for django-apikey-0.1.7.tar.gz
Algorithm Hash digest
SHA256 dfbf79629f35d30150d8129bff78f8ac6c2ad7fae64354314e5913e7daa687c7
MD5 8a83e64495e5d47b90bdae0cc456a756
BLAKE2b-256 d3ea3e15d312b4ff2a819cd2cf2e2ddb6e96390c81a5a7589dcb86b631f4474b

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