One of the best Django tutorials channel. Thank you for this great course.
@anshul85693 жыл бұрын
You can run ----> python manage.py drf_create_token username in your development server to generate token for a specific user as well.
@miguelalbors99833 ай бұрын
Thanks Mitch! Just love the course
@karlasosa53043 жыл бұрын
This is the best explanation I've found on this topic thank you so much!
@mister_stiv84112 жыл бұрын
Yes
@samucancld2 жыл бұрын
No one explain this like you man, thanks
@valanikevin3 жыл бұрын
The video is amazing. So helpful. But the only thing I didn't like is that he recommended deleting all users to generate Tokens. I mean what if you have 4300 Registration for your website?
@oruchkin2 жыл бұрын
generate token when your users login, so you dont need to delete old guys
@jimmyfl02 жыл бұрын
Thank you! Such a clear explanation! I wish you taught swift as well lol.
@alirn71414 жыл бұрын
Dude, Love this course :)
@alexseydugin8109 Жыл бұрын
About username, you can rewrite to your own obtain token view, you just need to copy past obtain token view and replace username with email.
@floridaman5295 Жыл бұрын
To work around deleting the superuser to generate a token for them you can temporally remove the 'if created' statement in the post_save receiver, login and update the user settings. Chances are you will get a duplicate error by that point. This leads me to believe simply logging in generates it.
@FootyPick5 жыл бұрын
Thanks loving it can we do more project based on this
@KIRILLINGUSS213 жыл бұрын
Your videos are great! Awesome course. Thanks, Mithc
@bibekshrestha92054 жыл бұрын
Could you please make the course of flutter using django api!? I love your courses
@badactor70712 жыл бұрын
Feel your pain brotha... I chose Django and flutter for my final year project too...
@kingkesylo85164 жыл бұрын
MANNNN YOU ARE THE BEST OF BESTS. THANK YOU VERY MUUUUUUUUUUUUUUUUUUUCH
@darkcast3454 жыл бұрын
11:50 you can add token through the admin on the top right.
@codedbychavez81904 жыл бұрын
I love this tutorial, Thank you!
@TheStoicPlayer644 жыл бұрын
To generate tokens for already created users do this :- > python manage.py shell >>>from django.contrib.auth.models import User >>>from rest_framework.authtoken.models import Token >>>for user in User.objects.all(): ... Token.objects.get_or_create(user=user) ...
@nikonmohapatra68532 жыл бұрын
A good video but a small correction: username becomes a required field because in definition you have REQUIRED_FIELDS = ['username'] . Without that username is not required
@winningtech5 Жыл бұрын
NO it does,nt make it a required field. check the documentation. you require that to make the email the primary login field
@ivonherms4 жыл бұрын
Thank you for the tutorial Mitch! I just want to ask how I can fetch the data from the REST API? I mean I can Login or Get the data or even insert a data using Postman. But how can I do it using Django? For example, I made another Django Website and I want to use the REST API that I made from my first website. How can I do it? Thanks again :)
@akhileshchander53074 жыл бұрын
Very helpful tutorial
@GurjeetSingh-wj5cd4 жыл бұрын
Nicely explained 👍
@mister_stiv84112 жыл бұрын
Thanks for video
@leewilliam86064 жыл бұрын
Can you add a video about JWT?
@sunapanareloaded70033 жыл бұрын
Really helpful 👍
@theshubhagrwl4 жыл бұрын
Super helpful.
@HyacintheKouadio4 жыл бұрын
I followed the tutorial completely, I even downloaded it but I encounter this error in postman "non_field_errors": [ "Unable to log in with provided credentials." ] } Can you help me please ?
@valentinfontanger49624 жыл бұрын
create a new user and then fill the form with the credentials
@TheCecchino984 жыл бұрын
dunno if you might still need this, but i had the same problem and the reason was that my passwords weren't hashed during registration. Watch the previous tutorial and make sure you call set_password() in your registration serializer
@adj-xw1je5 ай бұрын
@@TheCecchino98 thank you really
@nirajankarki66264 жыл бұрын
Awesome , Subbed
@sergekossi37694 жыл бұрын
Awesome tuto
@mohamedarafa97193 жыл бұрын
Thank you so much
@francmape4 жыл бұрын
Thank you sooooo much. What about logout!
@Tauseef3 жыл бұрын
When working with microservices how will the token authentication work with different service, for example I have ecommerce, forum as different services. So how can I authenticate the Tokens between different services?
@petrice34614 жыл бұрын
Hi Mitch,I recommend jwt
@hadramielbey84433 жыл бұрын
شكرا 💙
@skpaik4 жыл бұрын
Hi Mitch, Nice tutorials. Can you suggest me a tutorial about passwordless authentication in drf base web application?
@codingwithmitch4 жыл бұрын
Never done that
@RizwanAli-bu5oy5 жыл бұрын
How to create logout api in DRF?
@wanyoikedanny4722 жыл бұрын
following brightly
@parrot7854 жыл бұрын
In 0:55 it's said that every time the user logs in, the token is generated. I get same token returned after every login. Apparently the token is generated only one time. Anyway I like this course!
@codingwithmitch4 жыл бұрын
Yes you're right I goofed on that. You can configure it to generate a new token every time. But I did not.
@rafsananwar33084 жыл бұрын
do you get the same token after doing logout and re-login???
@ranjithsankar30104 жыл бұрын
hey by registering a new user, it has the role of admin right? means using that credentials we can login to admin panel, right?
@jhoniemusic4 жыл бұрын
What if the user is created under models.Model. can this still work. If not, is there's anyway to make it happen
@junevue96652 жыл бұрын
Is this how do authentication to all api endpoints
@usmanimtiaz15194 жыл бұрын
it show error at:token = Token.objects.get(user=account) account is not defined
@bekzodnegmatillaev89744 жыл бұрын
how to implement that create_auth_token() function with APIView?
@mahatibharadwaj32303 жыл бұрын
how do you read that token from the request in function api view? The token is generated from outside Django application but is included in the header. The user id also authenticated outside django. So I do not want to send the username and password for Authentication.
@poojanshah8684 жыл бұрын
Can't we generate new token every time user logins?
@codingwithmitch4 жыл бұрын
Yep, I think that's a good idea.
@poojanshah8684 жыл бұрын
@@codingwithmitch Well, Thanks for your reply but I am stuck there as it throws error if I try to generate new token for same user. Can you help me sharing any link or code snippet how should I do that! It will be a great help. Thanks in advance.
@valdrinkuchi4354 жыл бұрын
@@poojanshah868 "Knox token authentication" hope it helps have a look at this link kzbin.info/www/bejne/ZpWalHycnt6Xd8U
@teamexplorer28653 жыл бұрын
Method \"GET\" not allowed.
@zahrahosseini58804 жыл бұрын
I followed the tutorial completely but I encounter this error in postman "Cannot query "example@yahoo.com": Must be "User" instance.can anyone help me?
@johna-h2m4 жыл бұрын
your awesome
@classicguy78133 жыл бұрын
why the same token
@syrgakomuraliev3 жыл бұрын
13:50 - what does .key method do? I thought we have only keys()
@D0ni3cz3 жыл бұрын
its an attribute of the "Token" object.
@mahipalsingh93614 жыл бұрын
Is there a way to make sure that a token will expire if a request is not sent in 10 minutes from last request with token?
@himanshupoddar13954 жыл бұрын
someone??
@KushanVora4 жыл бұрын
Came here looking for an answer for this
@mahipalsingh93614 жыл бұрын
I think django-expiring-token is worth looking into it will extend the expiration time with each new request and we can set the time for token so if we set 10 mins it will expire the token if there has been no request in last 10 minutes And if there is any request after 2 minutes of token generation then the time will extend to next 10 minutes
@PrAsHaNtHdUke1093 Жыл бұрын
hi sir is this permanent token?
@diego.coder264 жыл бұрын
django token vs jwt ?
@JESSUTORTO3 жыл бұрын
does someone knows how to retrieve the token when registration in a viewSet?
@stackover12532 жыл бұрын
can you please send me the source code
@ba-en1io3 жыл бұрын
hi! I am able to generate the token for admin, but not for other users. do you have an idea why and is anyone else having this problem? and I am also getting error ValueError: Cannot query "bisma@hotmail.com": Must be "User" instance.
@dawoodamir20115 жыл бұрын
Nice shirt dude
@codingwithmitch5 жыл бұрын
You live near whistler BC?
@dawoodamir20115 жыл бұрын
No i actually lives in asia
@dawoodamir20115 жыл бұрын
Can u please tell me one thing
@maximemoreau7114 жыл бұрын
This tutorial is not bad, but from a security perspective it's really BAD! Please consider what you're doing before publishing... talk a little bit about the risks of lifetime tokens.
@mohamedabdi83774 жыл бұрын
Can you please explain? What would you suggest from a security point of view? I would like to benefit from your recommendation. Thank you.