Django Rest Framework Apikeys 0.1

django-rest-framework-apikeys 0.1

Last updated:

0 purchases

django-rest-framework-apikeys 0.1 Image
django-rest-framework-apikeys 0.1 Images

Free

Languages

Categories

Add to Cart

Description:

djangorestframeworkapikeys 0.1

=====django-rest-framework-apikeys=====django-rest-framework-apikeys allows you to Authenticate your REST api with api keys on a per user basis.Install-----------1. Install via pip:: pip install django-rest-framework-apikeysQuick start-----------1. Add "django-rest-framework-apikeys" to your INSTALLED_APPS settings like this:: INSTALLED_APPS = [ ... 'django_rest_framework_apikeys', ]2. Add the authentication class:: REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( ... 'django_rest_framework_apikeys.authentication.APIKeyAuthentication', ) }3. Run `python manage.py migrate`.4. Add urls to urlconf:: urlpatterns = [ ... url(r'^apikeys/', include("django_rest_framework_apikeys.urls")), ]5. Send a POST request to /apikeys/create/ to create API Key for user or create via admin6. Add 'x-api-key' to header to Authenticate via api key:: response = requests.get( url="http://0.0.0.0:8000/endpoint, headers={ "x-api-key": "fd8b4a98c8f53035aeab410258430e2d86079c93", }, )

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.