Join my free course on building a Todo API with Django REST Framework: prettyprinted.com/djangotodoapi
@aldemarocruz96682 жыл бұрын
I think this is the best video with django anfd JWT
@auroshisray91402 жыл бұрын
Thanks man...for the simple explanation
@Myskyink6 жыл бұрын
I have been following you since my days of learning flask. Your tutorials are simply the best. Please make videos on authentication, permission .
@prettyprinted6 жыл бұрын
Will definitely cover those topics. Thanks for watching!
@minsukwon38334 жыл бұрын
loved watching your series! thanks a lot
@prettyprinted4 жыл бұрын
Thanks for watching!
@ABMA79 Жыл бұрын
My dear friend, I am a great fan of your youtube channel since I am an intermediate Django framework user. I do have a question, when do we need to make API for our application? from What I have seen, it is not obligatory unless you plan to share data with other entities or end users. So can you please tell me the goal of enabling API briefly?
@medoabdin4803 жыл бұрын
you are amazing Anthony you have a very good explanation style. bless you god
@johnquick72753 жыл бұрын
Outstanding video and explanation. Thank you.
@alexlindgren13 жыл бұрын
Great tutorial series, really appreciated it!
@dutchprime14883 жыл бұрын
Great tutorial, it helped me understand how the package works!
@mrmuranga3 жыл бұрын
awesome.... thanks
@MiRaje80863 жыл бұрын
thank you so much man
@thomasshowers66826 жыл бұрын
I think the reason your signature was invalid on jwt.io is because you weren't using the secret from your settings.py file. When you toggle the 'secret base64 encoded' option it creates a new token using "secret" as the secret (10:50). If you put the secret from settings.py in that box and paste your token again it should work with 'secret base64 encoded' unchecked.
@AryanGNU4 жыл бұрын
You are awesome man, Thanks a ton
@veziop2 жыл бұрын
so if i understand correctly, this is a way of proviging an 'API token' for the users of our django REST API once we deploy it? I imagine in our documentation we include a step for acquiring the tokens only if the user inputs the relevant data into a POST method to '/api/token/' just as shown in this video. am i correct or am i missing something?
@tomouyt6 жыл бұрын
Great tutorial, straight to the point and with very good explanations.
@prettyprinted6 жыл бұрын
Thanks for watching!
@fabricioaugusto63246 жыл бұрын
You saved my life. Thank you!
@prettyprinted6 жыл бұрын
Glad i could help!
@serhii.chumachenko6 жыл бұрын
It's awesome! Thanks!
@prettyprinted6 жыл бұрын
Thanks for watching!
@mrmuranga5 жыл бұрын
Really simple to use......thanks Anthony... Compared with Django Rest Knox would you say JWT is more secure or faster ?
@MrIgorbpf6 жыл бұрын
Great video, man! Could u do a series using djoser and JWT of the whole process of authentication? I men signup, login, password reset, email and etc. That would be awesome!
@prettyprinted6 жыл бұрын
I'll look into djoser. Thanks for the idea.
@abirulezz6 жыл бұрын
oh yeah please do!
@sabitmahmud76526 жыл бұрын
hello Anthony !!As SuperUser can create lots of user according to their roll but Using JWT with DRF returns a response for Refresh and Access token. But it is impossible to define which user it is ! How can I return or pass a value by which I can able to understand what type of user it is?
@nguyenconghuy38472 жыл бұрын
how can I declare which api need access token and which doesn't in django
@DANJUMA96 жыл бұрын
Simple and short!!
@prettyprinted6 жыл бұрын
Thanks for watching!
@johncollera3 жыл бұрын
Can you write the code to POST and get the the token... so the code will automatically get the JWT and then use that to return the data
@stanleyjohn46704 жыл бұрын
I want to use a LOGOUT API that logs out the current user and deletes/removes the existing access token. The access token has an expiration date of 1 year (my requirement) but can be deleted/expire once a user logs out. How can I do this?
@hariprakasham4 жыл бұрын
hi I have a doubt .. from where you referred paradigms .. ?? this the source of paradigms is not displayed in this video ..
@jonathanma45013 жыл бұрын
Hi, this was a great video. I have a question - like in the video, you created an access/refresh token with a given username and password. But what if you want to only allow some users to make the access/refresh token? For example, only paid users, or only users who have registered as an account? Would I have to implement logic in the views so that it checks with a database for preexisting users, or do I have to create a signed url to get access to make the token? What's the best way of restricting token creation? Or, should I have only a server side application connect to this resource api to create the access/refresh token, which I then pass to the frontend as a response?
@veziop2 жыл бұрын
i find this question interesting
@abhishektayal4802 жыл бұрын
For that we have to use permissions along with jwt.
@toufanialfarisi18665 жыл бұрын
it's really really awesome
@prettyprinted5 жыл бұрын
Thanks!
@highskill6 жыл бұрын
Thank you! 🙌
@dgiri23335 жыл бұрын
Hi how to create nested serializer like if select district then it's show model list ,if model select all village can show on villages how to implement
@dcatalyst62714 жыл бұрын
hey can you make a Django snowflake database connection video I have searched allot but not found the solution anywhere
@harshilgohil39185 жыл бұрын
Hello!, After installing djangorestframework_simplejwt and after updating 'DEFAULT_AUTHENTICATION_CLASSES' in settings.py and adding proper imports in urls.py .I am getting a ModuleNotFoundError: No module named 'rest_framework_simplejwt'. Is there any other dependency I need to install? Thanks in advance!
@stev38864 жыл бұрын
Did you install it in the right virtual environment? sometimes people made this mistake
@msasoftware5 жыл бұрын
:) Excelent. Thanks you so much
@blog.pymastery5 жыл бұрын
Everything is well done. However, why I can't access Django Database essential, it says that 404 page not found !? Help, please.
@victorazuara33466 жыл бұрын
Excellent, thank you
@prettyprinted6 жыл бұрын
You're welcome. Thanks for watching.
@akshhay4 жыл бұрын
How to implement this in a form in django?
@kutluaydn15083 жыл бұрын
I don't want to use library for jwt. Is there any source for python jwt?
@chesterholt55515 жыл бұрын
Superb
@prettyprinted5 жыл бұрын
Thanks for watching.
@xtremehackerzpro95116 жыл бұрын
Excellent :)
@whateverreally4 жыл бұрын
Hey dude, I'm getting an error, just gonna paste it here: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /authors (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',)) This occurs when I'm tryna run the send.py file. Can you let me know what I can do? I kinda need help asap. Thanks bruh.
@whateverreally4 жыл бұрын
FYI, I did not use POSTMAN, I got the token directly from the website after I entered the login credentials.
@bravmi6 жыл бұрын
You rock dude
@prettyprinted6 жыл бұрын
Thanks for watching!
@wayneloo82346 жыл бұрын
That's really cool. But I think the user login is validating against the user model in the database. What if we're using external methods like ldap? How does it work? Do you have a video on that?
@prettyprinted6 жыл бұрын
No video on ldap, but I'll consider it for the future.
@CerebroVasconcelos5 жыл бұрын
Thanks for to do this video
@prettyprinted5 жыл бұрын
You're welcome! Thanks for watching.
@nurizzati58925 жыл бұрын
i hope you do token based authentication with django rest framework
@prettyprinted5 жыл бұрын
I'll probably cover that in the future.
@rayaangrewal10355 жыл бұрын
awesome
@ChantOfSpirit5 жыл бұрын
Author, what I should do with {% csrf_token %} template tag ? I can't remove it... How I can use my login/logout forms with new token?
@ZainAli-me4qk4 жыл бұрын
Can you please tell me how to create multi-users like Sellers buyers and admin with their roles i need model and serializers for 3 users model. Please help
@shubhamkumar94844 жыл бұрын
from where paradigms came i lost it there
@politicallynotcorrect29684 жыл бұрын
how do i create a routh only for auth users
@learnwithfun1476 жыл бұрын
Hey Pretty good job man. Can you do Class Based View tuths. Waiting for it :)
@prettyprinted6 жыл бұрын
Yep, that's on the list. Thanks for watching.
@Skaxarrat6 жыл бұрын
I did this series two times, from scratch, but when I get to this point I start to have issues. I've 'pip installed' rest_framework_simplejwt', added it to settings.py and created the two endpoints to 'api/token' and 'api/token/refresh', yet I still don't get the 'Authentication credentials are not provided' message. Anyone is having the same issue as me and fixed it? Keep in mind I've tried this two times from scratch
@fester65376 жыл бұрын
From what I can tell your permission is set to 'permissions.IsAuthenticatedOrReadOnly' instead of 'permissions.IsAuthenticated'. It should works if you change both permission in your settings.py and your LanguageView.
@niteshrawat5766 жыл бұрын
are declaring permission class as AllowAny or authentication class as IsAuthorizedOrReadOnly? If yes, then please don't.
@davidmutua69715 жыл бұрын
Actually this is not a problem you must make sure first your local django development server is running. The message may vary like mine too doesn't show that when I post using postman but it does when using "Insomnia" software. It's similar to postman but simpler. Postman is a beast though.
@ahadulislam88915 жыл бұрын
Nice Video bro. But is there any way to use JWT without DRF(Django Rest Framework ). Thank You
@prettyprinted5 жыл бұрын
Yeah, check out my JWT videos with Flask. The concept will be the same in Django.
@sankarbathula87586 жыл бұрын
Thanks a lot...!
@prettyprinted6 жыл бұрын
You're welcome! Thanks for watching.
@amirshehzad33525 жыл бұрын
@Pretty Printed How are you connecting python in Ubuntu Bash with VScode?
@prettyprinted5 жыл бұрын
I don't actually. I keep them separate. I eventually need to connect them though.
@msasoftware5 жыл бұрын
More options in: www.django-rest-framework.org/api-guide/authentication/#third-party-packages
@georgesmith30225 жыл бұрын
by default, for how long is the token valid?
@prettyprinted5 жыл бұрын
Five minutes. You can see the defaults here: github.com/davesque/django-rest-framework-simplejwt#settings
@georgesmith30225 жыл бұрын
@@prettyprinted thanks
@nagaraja48465 жыл бұрын
how can i generate jwt custom token for django api...Thank You Advance.
@manhha30109326 жыл бұрын
Hi! I'm counfusing after learn Django Rest framework, what django REST do? how to render those data to front end? because this is just pure data, how to use it in front? I am beginer so sorry if dumb question, thanks !
@prettyprinted6 жыл бұрын
If you want to display data, you can use the traditional template features of Django. Another way to render pure data is by using a frontend framework like React. I recommend looking into templates first though.
@sumitprakash27474 жыл бұрын
Hi I am getting ModuleNotFoundError at / No module named 'rest_framework_simplejwt'
@kancharlanikhilsai98386 жыл бұрын
I was looking for this type of video and got yours. Excellent video. Thank you so much. The username and password are from auth_user table in db. Is there any way to take username and password from another table we create for storing users.
@prettyprinted6 жыл бұрын
Everything in DRF can be customized, but it takes more code. But yeah, you can change to a different database.
@kancharlanikhilsai98386 жыл бұрын
where to modify the code to get the user details along with the tokens generated.
@mdk1244 жыл бұрын
@@prettyprinted Is there a direction that we can look at for this?
@mdk1244 жыл бұрын
@@kancharlanikhilsai9838 Hi! Did you manage to solve this issue you were facing?
@JonesDTaylor6 жыл бұрын
Hi Anthony Your videos are nice. Can you please show the audiance where do you get your code from ? for instance the settings.py changes for token authentication. It helps if you show the location (obviousily from the official doc of restframework) from which you get the code. Thank you
@prettyprinted6 жыл бұрын
It's not practical for me to give all the locations in the docs, but the extension's documentation isn't too complicated so you should be able to see if it you go to the relevant section.
@alexanderlabrador56086 жыл бұрын
how can I consume this api from a fronent or an html with ajx ?
@swaali16 жыл бұрын
hello , can i use it for cb token adder thankssssssssssssss
@amangautam66625 жыл бұрын
When i'm trying to get access token and refresh token using curl command curl -X POST -H "Content-Type: application/json" -d '{"username":"myusername", "password":"mypassword"}' localhost:8000/api/token/ i'm getting error username and password this field is required but it is working with postman api testing
@frostsmaker89664 жыл бұрын
How to get user_id from the access token/ authenticated user in views.py?? I want to use the object manager to get data using user_id.
@christianmagnus10034 жыл бұрын
Hello buddy, i have a questions, that username and password was by the Admin user really? i mean that token is only for superuser in django rest framework, not for normal users yes?
@huzaifquazi4 жыл бұрын
how can i get token for user and not admin ?
@georgesmith30225 жыл бұрын
are the google api keys jwt tokens?
@prettyprinted5 жыл бұрын
No, they're tokens specific to Google.
@georgesmith30225 жыл бұрын
@@prettyprinted thanks for answering
@SidonDuarte6 жыл бұрын
What is the differences between "django-rest-framework-jwt' and "django-rest-framework-simplejwt ( github.com/davesque/django-rest-framework-simplejwt ), what its advantages and drawbacks for each one?
@prettyprinted6 жыл бұрын
Generally the differences between any similar libraries are just the patterns. So try out both and see which pattern you like best.
@oluwafemimatthew35016 жыл бұрын
Is there any reason behind your choice of github.com/davesque/django-rest-framework-simplejwt as against a more established github.com/GetBlimp/django-rest-framework-jwt. Nice video by the way, clear and concise
@prettyprinted6 жыл бұрын
No particular reason. If you can use, then you should be able to figure out the other. Thanks for watching.
@gopalsivethna29596 жыл бұрын
hello sir i am brown person and u r smartents black person i know, thanks for the help!