Django Rest Framework: User Token Authentication || Login, Register, and Logout
ฝัง
- เผยแพร่เมื่อ 6 พ.ย. 2021
- In this tutorial, you'll learn how to authenticate users in Django Rest Framework using the Knox Library.
DRF Authentication: www.django-rest-framework.org...
Django Knox documentation: james1345.github.io/django-re...
download postman: www.postman.com/downloads/
please share the link to the source code
Source Code:
github.com/iradualbert/yt-python-projects/tree/master/drf-auth
Pero como uso ese token desde el login de otro sistema ?
Thank your Albert, I'm gettin' into DRF and this tutorial was very clear to me. Thank you very much bro.
It was best...for django rest api Authentication ❤❤❤
Awesome video, helped me out a lot 😃
Awesome, thank you!
bro Thank you...u are genious.
Nice video
Thanks a lot 😊
Most welcome 😊
I had a problem when I created new user using endpoint. The problem was with RegisterSerializer - the password wasn't saved correctly - django admin - 'Invalid password format or unknown hashing algorithm. Raw passwords are not stored, so there is no way to see this user’s password, but you can change the password using'.
One of the Solutions is:
def create(self, validated_data):
user = User(
email=validated_data.get('email'),
username=validated_data.get('username'),
first_name=validated_data.get('first_name'),
last_name=validated_data.get('last_name'),
)
user.set_password(validated_data.get('password'))
user.save()
return user
thanks very much
tnx bro
My Login route is nt returning user details... Its Say ReturnDict' object is not callabe
Hello excellent video!, when I create a user does not recognize the password, it says "
Invalid password format or unknown hashing algorithm."
do you know how to fix it?
I never understood how I am supposed to serve my views and templates in the front end server with the right Token for every user is trying to login..
what is meaning of knox in django?
Do you have any video login in with dja go rest api and volley ?
Not yet!
I have a django rest api I need to consume. But I'm have a csrf token error in my postman. How can I bypass this error ? The login works well on browsers but not in postman.
You can try the @csrf_exempt decorator
cant login other users except for the admin......."non_field_errors": [
"Unable to log in with provided credentials."
]
Where you able to resolve this?
Hi @ALBERT
i have seen many video regardi api but Nobody teach how to use signupapi in Html i.e how to send data from html to backend
how to use api in frontend as signup api,login api this is challengi task
knox is not working for django 4.0, its shwoing some errors. is there any way to fix it? for django 3.2, its working
have you found a way?
@@fayzulsuleiman672 no. Still searching
I really like the content as it is clear and understandable though boring. The way you don't explain much and you are kinda passive leaving things to run without talking much makes it boring. In the future kindly be very active explain explicitly how, why, to keep audience active too. Again your tone is low. That makes it boring.
please try to work on those areas, again i really like the content in the video since it is teaching alot of important content. thanks alot.