Django & React Session Authentication and CSRF | Part 3 - Sign Up and User Profile

preview_player
Показать описание
🔥 Subscribe to my YouTube + Turn on Notification Bells!

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

Today I'll be sharing the third part for setting up a session based authentication system that I will help you implement using React, Redux, and Django with the Django Rest Framework. I will also be using Bootstrap for the styling in the application.

This is going to be a session based authentication system with some awesome features:
1. You will see how to implement session authentication in a Django & React app.
2. You will learn about what CSRF is and how we protect against it.
3. You will learn how to use a CSRF Token to protect your login and sign up pages.
4. You will learn how to use a CSRF Token to protect your authenticated API requests.
5. You will learn how to attach a profile to your user which you will be able to update.
6. You will learn how to add functionality for deleting a user through the user dashboard.

In this part, I will be setting up the user profile model, and setting up the sign up view and url so that a user can sign up for an account in the application. You'll also see how you can obtain a CSRF token, have your sign up view CSRF protected, and how to pass a CSRF token along with your API request when you go to sign up.

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

Рекомендации по теме
Комментарии
Автор

Perfect qualitty content video. Thank you for your every minute of your effort.

mustafayildirim
Автор

some notes for myself:
- add the CSRF decorator to the view that you’re making a POST request to
- create a new view (getCSRFToken()) that will generate the CSRF token in the cookies response (this view will be accessed via GET)
- copy the CSRF token from getCSRFToken() into the POST request
- submit the POST request, you should not see the “CSRF cookie not set” error

haikalyusuf
Автор

Thank you very much for the tutorial, super helpful. Could you please tell if there is a more standard way to organize validation in Django? Something like listing all the conditions and passing to a function that performs the validation and raises an exception if some conditions are not satisfied? The way it's done in the video of course works but I wonder if there's another solution, cause it's a little bit cumbersome to update if a new condition comes up

leonidkonstantinovich
Автор

please make video in auth0 authentication with react or next js🙏

coderunner
Автор

amazing video. thank you for sharing. <3. but would this make a vulnerability since people can access the function that gets the csrf token?. I am still new to the session based authentication so I don't know

ahmedkamel
Автор

Forbidden (CSRF cookie not set.): /api/login/

beetbeatbitlive
Автор

Hi. Brayan!
Doesn't it make sense to wrap TemplateView that contained bundled react application into ensure_csrf_cookie? instead of creating additional view for getting it.

idigger
Автор

thank you so much for this tutorial, saved my life xDDD

knightblanc
Автор

hi Brayn. will you use djoser in this series ?

mynamex
Автор

Hi @Bryan Dunn, thanks for uploading this awesome tutorial again. I was facing a problem in simple JWTAuthentication. I can get the refresh and access token through auth/jwt/create/ and while i send a get request for authentication to auth/users/me/ server send 403 forbidden with "detail": "Authentication credentials were not provided.". Why it's so, I'm using apache2 as my server and Mysql as my database. Other configurations I have done as you have done in the tutorial. Please hel me out

narendrathapa
visit shbcf.ru