Learn Vue - Towards JWT authentication | Vue and Django API | Vuex Store

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

Комментарии • 74

  • @DennisArce-v3b
    @DennisArce-v3b Год назад +1

    Thank you very much for this fast course about integrating Django as API with Vue

  • @joemaylor5223
    @joemaylor5223 4 года назад +6

    This is great. Thanks so much. As someone learning development, I have a decent understanding of building a simple API, and a simple frontend separately, but linking the 2 together like this is really not demonstrated enough and is super useful!

    • @veryacademy
      @veryacademy  4 года назад +1

      Thanks Joe, glad you managed to get value from it

  • @andressalimaferreira414
    @andressalimaferreira414 Год назад +1

    Your videos are incredible. I would like to ask a question. I noticed that the link named Post is no longer in the Navbar file for this project, as it was in the previous video. In this video he appears on the page with the posts, so I would like to know where he is being indicated?

    • @veryacademy
      @veryacademy  Год назад

      Sorry I can’t support this tutorial anymore, it was created a very long time ago.

  • @aminebouhaddi5749
    @aminebouhaddi5749 3 года назад +4

    The best tutorial i've see, god bless

  • @samerelhamdo1104
    @samerelhamdo1104 4 года назад +1

    THE BEST tutorial on youtube Thanks 😊

    • @veryacademy
      @veryacademy  4 года назад +1

      Hey Samer, thank you. Glad you found it useful. I will get back onto Vue.JS soon enough. The first tutorial I will do will be based around the Django Restful tutorial series I am doing at the moment where I will take this tutorial much further and in more detail. There is a few things missing if I remember from this tutorial - Not sure I got the refresh token working for example. 👍

    • @samerelhamdo1104
      @samerelhamdo1104 4 года назад

      @@veryacademy It will be great and complete content

  • @ammaralzhrani6329
    @ammaralzhrani6329 2 года назад +1

    Thanks 🙏 is this vue server side rendering or client side rendering?

    • @veryacademy
      @veryacademy  2 года назад

      It's been so long, I can't remember sorry!

  • @gauravmahadik1245
    @gauravmahadik1245 4 года назад +2

    Thank you so much for making this! I was able to learn so many things using Django and Vue. Thank you so much!

    • @veryacademy
      @veryacademy  4 года назад +2

      Thank you for watching, good luck with your future developments

  • @sambad8429
    @sambad8429 3 года назад

    Thanks for this very informative content. My question is: it safer to use Localstorage or cookies to store the token?

  • @mondayudosen6904
    @mondayudosen6904 3 года назад +4

    Great tutorial, i love it. Please, when will you implement the full login part, especially saving the token so that it dosen't log me out when ever i refresh. Also i'll like to see a tutorial where i can implement authorize view base on two or more conditions. thanks

  • @kirillkruglov1418
    @kirillkruglov1418 4 года назад +4

    Greatest tutorial in a whole youtube on django&vue authentication !
    All these timecodes and stuff, lots of preparations for high quality content, thank you !!!
    Please continue Python & Vue stack, its so little about this in the whole Web, in comparison with other frontend frameworks...
    P.S. im getting automatically logged out silently using your github code, what can be the problem?
    P.P.S can you make a full sign up, sign in, sign out tutorial, plz ? ( that was sooo cloze :) )
    P.P.P.S perfect english man, pleasure to listen )

    • @veryacademy
      @veryacademy  4 года назад +2

      Thanks Kirill, RUclips is pretty big I would like to think it’s not the best. I did originally make the login system much more complex and complete but as you say these things take so long to prepare. You might be logged - see last step the idle timer? Are you being logged out by that? I definitely want to do a full login system tutorial. I will make a part 2 from this tutorial and build upon it to create the function you mentioned. Definitely will see more Django and Vue. Any other tutorial suggestions please let me know

    • @kirillkruglov1418
      @kirillkruglov1418 4 года назад +1

      Thanks, i really misunderstood the conception of idle timer ...
      In general, there are plenty good tutorials on Django, as well on Vue, but for me as a beginner the key problem is integration between the two. So, after completing Vue tutorial on authentication (firebase), i'm still unable to make this work with Django. The same with Django tutorials (that are mostly based on react frontend).
      Sure, it's due to my lack of experience, but if you make content on Django + Vue functionality, that will be PRECIOUS ! (just anything, img upload, forms, blog, comments, rating, literally anything you consider to be useful)
      Have a nice day )

    • @veryacademy
      @veryacademy  4 года назад +1

      Thanks that’s really helpful

  • @soklagenhet
    @soklagenhet 4 года назад +3

    Any chance you could do this part, except using httpOnly cookies for authentication? Seems really hard to find.
    A lot of evidence suggesting localstorage is unsafe for storing the token based on OWASP recommendations due to javascript being able to access it, risk of XSS.
    Afaik simple-JWT for django doesn't allow for the token to be sent as a cookie though

    • @veryacademy
      @veryacademy  4 года назад +1

      Received and working on it

  • @artemsymcov3980
    @artemsymcov3980 3 года назад +1

    With JWT token, how we can allow to new users to register? in tutorial you created new user by terminal. What can we do, if user don't have access to admin panel?

    • @veryacademy
      @veryacademy  3 года назад

      Hey Artem, sorry for not getting back to you. It is a long answer, but you just, I say just, need to build a login feature!

  • @tommasodemarco7103
    @tommasodemarco7103 4 года назад +1

    Amazing content! So useful!

    • @veryacademy
      @veryacademy  4 года назад +1

      Glad you think so! Thank you! 👍

  • @patrickpelsma
    @patrickpelsma 4 года назад +2

    Awesome video! I am learning so much with your tutorials!
    How would you incorporate LocalStorage with this code, so a user stays logged in when he navigates to different pages. And is it possible to register users too?
    Keep up the good work ;-)

    • @veryacademy
      @veryacademy  4 года назад +3

      Hi Patrick, sorry when I built that, I was too much in a rush to get it out that I left it out. It is a simple process. I am itching to get back to vue. My next vue / Django tutorial will be a full login system with user access levels. Promise it won’t be long to wait - end of next week I am aiming for - hopefully before! To answer your question directly is difficult without just building you an example.

    • @patrickpelsma
      @patrickpelsma 4 года назад

      @@veryacademy first of all, don't be sorry! You are making great tutorials! Looking forward to seeing your new video next week. It would be great seeing the tutorial with password reset too :D

    • @patrickpelsma
      @patrickpelsma 4 года назад +1

      Hi @@veryacademy! I was wondering when you are going to release the full login system with user access levels, really curious to see your tutorial!

    • @sabitrakhanal1113
      @sabitrakhanal1113 3 года назад

      @@veryacademy We are still waiting for it.

  • @nareo6358
    @nareo6358 3 года назад

    Thank you so much for your tutorial, it is so good.
    I am a beginner of vue and django, when I tried to run your project, it logs me out every time I refresh the page or click the post page. I tried to change the idletime to a larger number, and tried to delete the IdleVue related code, but it still not works, so what is the problem? Thank you so much for your help.

  • @yugalkhanal6967
    @yugalkhanal6967 Год назад

    do you have a tutorial on how to register for an account?

  • @bishwobhandari5132
    @bishwobhandari5132 4 года назад

    The best tutorial about vue and django so far in the internet. Thanks man!!!

    • @veryacademy
      @veryacademy  4 года назад

      Thank you! Only have 2 or 3 videos with Vue and Django. They are very popular that is for sure!

    • @bishwobhandari5132
      @bishwobhandari5132 3 года назад

      @@veryacademy can you do a video on how we bundle Django and vue with webpack and make a single deployable Django build?

  • @omkarprakashbhosale8338
    @omkarprakashbhosale8338 4 года назад +1

    Thank u so much brother for this tutorial.....brother please tell me how to send csrf token through vue for django application

    • @veryacademy
      @veryacademy  4 года назад

      I dont think I have an example to show you but here is something that might be useful:
      stackoverflow.com/questions/43567052/csrf-token-of-django-into-vuejs-when-seperate-them

  • @arpitsoni9378
    @arpitsoni9378 3 года назад

    I want full video with refreshing token plz

  • @SomebodyOutTh3re
    @SomebodyOutTh3re 3 года назад

    Thanks for the video, but a lot of stuff is missing.
    How to deal with expired token?
    I save accesToken in localstorage but it expires quickly, how to fix that so that it automatically get new token using refeshToken to stay loggedIn ?

  • @ShahriyarRzayev
    @ShahriyarRzayev 3 года назад +1

    If you have encountered an error "'str' object has no attribute 'decode'", it is likely due to version of PyJWT.
    So just run -> pip install PyJWT==1.7.1

    • @veryacademy
      @veryacademy  3 года назад +1

      Thank you! - This is a bit outdated now - wont be too long new vue soon! Well about 4-8 weeks 👍

    • @ShahriyarRzayev
      @ShahriyarRzayev 3 года назад

      @@veryacademy Wow good luck on this :) I will wait for new series. Currently, for this video I just follow the Vue part using Vue 3 - by converting your code to Vue 3)
      If you can consider to make a full version/production ready Auth integration series with DRF & Vue 3, that will be really amazing.

  • @codedjango
    @codedjango 4 года назад +1

    Thank you 😊

    • @veryacademy
      @veryacademy  4 года назад +1

      Thank you! What would you like to see next? I said I will start a React series so probably will do some basic React tutorials and then I need to get a load of Bootstrap and CSS done for work, but happy to assist you and take some suggestions as to what you would like to see. When I get the website up and running you can post suggestions there and I will have a 'Next tutorial list'. Hope you are well.

    • @codedjango
      @codedjango 4 года назад

      I am still trying to grasp the concepts you have taught in this video....Actually I have not been able to find such tutorials on vuex state management...but when I see this video on vuex, I think I can get a hold of it....But as always, I am grateful to you for such amazing video tutorials....Definitely I have gained more knowledge after going through your tutorials...Keep such videos coming on DJango+Vue......Thank you

  • @zakchips
    @zakchips 4 года назад +1

    So we don't need to store accessToken and refreshToken in localStorage. Or do I miss something? Thank you in advance.

    • @veryacademy
      @veryacademy  4 года назад +2

      Access Tokens can be stored where ever you would like to store them. There are some general recommendations as to where the safest place to store them.

  • @salehm9631
    @salehm9631 3 года назад

    thank you

  • @hidetorasato7518
    @hidetorasato7518 4 года назад +1

    Thank you soooooo much🙆‍♂️

  • @lauderday8
    @lauderday8 3 года назад

    Hey, many thanks for the great video, just was I was looking for! I followed your instructions all the way but I just cannot get REST to accept my JWT token. I tried it exactly like you showed it in the video with Postman and everything else was setup the same way. Any ideas by any chance?

    • @veryacademy
      @veryacademy  3 года назад

      Hi Lauder - sorry not to get back to you. Its a tricky one to suggest base on what you have said - sorry - does the code example work?

    • @lauderday8
      @lauderday8 3 года назад

      @@veryacademy Hey, thank you very much for your reply. It turns out that the order in which you include settings inside the settings.py for the REST framework matter. I had to place it above any other setting and only then did it work.

  • @THEHADIDA
    @THEHADIDA 4 года назад

    Found it ;). Thanks again for this wish I found it earlier!

    • @veryacademy
      @veryacademy  4 года назад

      Hi Joshua, glad you found it.

  • @dharmaputra7394
    @dharmaputra7394 4 года назад

    Best channel python framwork 👍request with flask

  • @venkatgangarapu3717
    @venkatgangarapu3717 3 года назад

    Can you provide references for localstorage or sessionstorage on your tutorial, when i tried to impliment it is not working.

  • @webdev1943
    @webdev1943 2 года назад

    thanks

  • @Thomas-mm5fr
    @Thomas-mm5fr 2 года назад +1

    What happens when token expires?

    • @veryacademy
      @veryacademy  2 года назад

      Hey, I will answer this more generally and we can start from there. When you first generate a token it is likely to have an expiration date attached to it. Therefore after that time it can no longer be used. A refresh token can be used to obtain a new key

  • @denieru88x
    @denieru88x 4 года назад +1

    hi grettings, i have a problem whem i test with postman i get this error 403 forbiden and in the return i get tha CSRF cookie not set. whats the problem ? thanks

    • @veryacademy
      @veryacademy  4 года назад

      Unsafe way but first check this - add this to the view
      @csrf_exempt
      def myview(request):
      ...
      As you might tell this will except csrf - if that solves the problem get back to me.

    • @denieru88x
      @denieru88x 4 года назад +1

      @@veryacademy sorry i solved that vuex error jeje thanks very good tutorial, ya resolvi el problema vuex, era una llave de mas :S xD soy de Venezuela pero ando en chile disculpa mi mal ingles xD saludos muy buen curso saludos

  • @kasperskjeggestad5036
    @kasperskjeggestad5036 4 года назад

    Is there a way to require login on all views (except for login) without manually writing it in meta for all views?

    • @veryacademy
      @veryacademy  4 года назад

      This might help you - thought that it wouldn't be useful for you just to say yes you can do it (i dont have any examples on the channel yet - but that would be a great tut, thank you)- stackoverflow.com/questions/48407790/restricting-all-the-views-to-authenticated-users-in-django

  • @amidemariolp5220
    @amidemariolp5220 2 года назад

    Top3

  • @abuajmalmajidponnethabu2858
    @abuajmalmajidponnethabu2858 3 года назад

    sir ur name?

  • @abooodl2187
    @abooodl2187 2 года назад

    i liked you allooot bur, in second time please put real files......... dont deleteeeeeeeeeeee guesssssssssss

    • @veryacademy
      @veryacademy  2 года назад

      Really sorry to let you down again! These are old tutorials when I was starting out.