Django REST Framework Secure Token Authentication

Опубликовано: 06 Май 2026
на канале: Bryan Berk
2,753
79

🔥 Subscribe to my YouTube + Turn on Notification Bells!
👉    / @bryanberk  

Final project code:
https://github.com/linkedweb/token-au...

Hey, Bryan here. I share videos that help web developers up their development skills!

Today I'll be sharing a tutorial showing you how to implement token authentication using Django with the Django REST Framework.

Here is an overview of the things you will learn in this tutorial project:
1. How to set up token authentication using Django with the Django REST Framework.
2. How to store the token credential in an httponly cookie.
3. How to handle cookies getting sent cross-origin.
4. How to set up CORS headers.
5. How to set up environment variables.
6. How to overwrite Django default behaviour to meet specific use cases.
7. And more!

Timestamps
0:00 - Intro
3:01 - Initial Setup
9:11 - Token Authentication
13:48 - Overwriting Auth Behaviour
16:07 - CORS Headers
18:10 - Custom User Model
25:13 - User Registration
33:18 - Testing Registration
35:20 - User Login
46:17 - Testing Login
48:45 - Retrieve and Update User
54:33 - Testing Retrieve and Update User
57:58 - Logout
59:46 - Testing Logout
1:00:40 - Outro

To stay up to date with the best web development content, make sure you subscribe to My YouTube channel Today!

Documentation links used in the video:
Django: https://www.djangoproject.com/
Django REST Framework: https://www.django-rest-framework.org/
CORS Headers: https://pypi.org/project/django-cors-...