Django application implementing API key-verification with Unkey RBAC.
This a starter Django application which implements API key verification with Unkey RBAC. There are two endpoints, a public one and a protected one that requires a valid API Key.
API ID
.Clone the repository:
1git clone https://github.com/Ionfinisher/unkey-django-template.git
Navigate to the project directory:
1cd <folder-root>
Install the dependencies:
1pip install -r requirements.txt
Change the .env.example to .env file and add the following:
1UNKEY_ROOT_KEY=your-root-key2UNKEY_API_ID=your-api-id
Get the root key from https://app.unkey.com/settings/root-keys
Start the server
1cd src/django-unkey/template_api2python manage.py runserver
curl the unprotected route
1 curl http://127.0.0.1:8000/api/v1/public
It should return Heeyaaa!! Touchdown to the public endpoint!!
curl the protected route
1 curl http://127.0.0.1:8000/api/v1/protected -H "Authorization: Bearer <YOUR_KEY>"
It should return Woohoo!! Touchdown to the protected endpoint!!
This project is licensed under the MIT License.
For further information, go to unkey.
2500 verifications and 100K successful rate‑limited requests per month. No CC required.