Authenticate Django Rest Framework Views with django-hawk
Project description
Django Hawk DRF
This package provides Django Rest Framework helper classes for use with Django Hawk.
Installation
Read the Django Hawk installation documentation.
Example usage
Read the Django Hawk example usage documentation.
from django_hawk_drf.authentication import HawkAuthentication
from django_hawk.middleware import HawkResponseMiddleware
from django.utils.decorators import decorator_from_middleware
from rest_framework.viewsets import ViewSet
class ExampleViewSet(ViewSet):
authentication_classes = (HawkAuthentication,)
permission_classes = ()
@decorator_from_middleware(HawkResponseMiddleware)
def list(self, request):
return super().list(request)
Testing
Tests belong in the /django_hawk_drf/tests/
directory. You can run the tests by installing the requirements like so:
pip install -r dev-requirements.txt
Now you can run the tests using the following command:
./manage.py test
Tox tests
We use tox to test compatibility across different Django versions.
To run these tests with tox, just run the following:
tox
Pushing to PyPI
Running make build
will build the package into the dist/
directory
Running make push-pypi-test
will push the built package to Test PyPI
Running make push-pypi
will push the built package to PyPI
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
Built Distribution
Hashes for django_hawk_drf-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a4cd160dcb339d3dde20c4e178ea866c8a936c07e087999f815e72dc7329ab5 |
|
MD5 | bbad8088f03b43af500ccbb7568a4c72 |
|
BLAKE2b-256 | e8e5cc5c1517a7440af766129d2745f8ed88f150b91b4e2041a3b154decd96c2 |