# API Key in django

**URL:** <https://forum.djangoproject.com/t/api-key-in-django/35043>\
**Category:** Getting Started\
**Created:** [September 23, 2024, 2:49pm UTC](https://forum.djangoproject.com/t/api-key-in-django/35043 "2024-09-23T14:49:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![afoysal](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/afoysal/32/20425_2.png) [@afoysal](https://forum.djangoproject.com/u/afoysal)\
**Post date:** [September 23, 2024, 2:49pm UTC](https://forum.djangoproject.com/t/api-key-in-django/35043/1 "2024-09-23T14:49:18Z")

</div>

How to generate API key in Django Rest Framework ?

---

<div class="post-metadata">

**Author:** ![leandrodesouzadev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/leandrodesouzadev/32/8981_2.png) [@leandrodesouzadev](https://forum.djangoproject.com/u/leandrodesouzadev)\
**Post date:** [September 23, 2024, 3:05pm UTC](https://forum.djangoproject.com/t/api-key-in-django/35043/2 "2024-09-23T15:05:11Z")

</div>

Hello there.  
A simple google search for “Django rest framework API key” led me to the documentation of DRF itself.  
Here’s the recommended way of dealing with API Keys according to [DRF docs](https://www.django-rest-framework.org/api-guide/permissions/#django-rest-framework-api-key)

---

<div class="post-metadata">

**Author:** ![afoysal](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/afoysal/32/20425_2.png) [@afoysal](https://forum.djangoproject.com/u/afoysal)\
**Post date:** [September 24, 2024, 3:09pm UTC](https://forum.djangoproject.com/t/api-key-in-django/35043/3 "2024-09-24T15:09:44Z")

</div>

Thanks @leandrodesouzadev . I am using this [library](https://florimondmanca.github.io/djangorestframework-api-key/) for API Key.

But how can I generate and use API Key ?

---

<div class="post-metadata">

**Author:** ![leandrodesouzadev](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/leandrodesouzadev/32/8981_2.png) [@leandrodesouzadev](https://forum.djangoproject.com/u/leandrodesouzadev)\
**Post date:** [September 24, 2024, 4:48pm UTC](https://forum.djangoproject.com/t/api-key-in-django/35043/4 "2024-09-24T16:48:58Z")

</div>

I’m sorry, you referenced the documentation of the library that you’re using, and there’s a explicitly section on how to do what you’re asking for.  
Read the documentation.
