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/

ความคิดเห็น • 29

  • @zaheeruddinbaber6762
    @zaheeruddinbaber6762 2 ปีที่แล้ว +2

    please share the link to the source code

    • @AlbertDevshot
      @AlbertDevshot  2 ปีที่แล้ว +4

      Source Code:
      github.com/iradualbert/yt-python-projects/tree/master/drf-auth

    • @alonsogarrido3448
      @alonsogarrido3448 ปีที่แล้ว

      Pero como uso ese token desde el login de otro sistema ?

  • @rafael0084
    @rafael0084 ปีที่แล้ว

    Thank your Albert, I'm gettin' into DRF and this tutorial was very clear to me. Thank you very much bro.

  • @ShibliSabbir-ll8wc
    @ShibliSabbir-ll8wc 7 หลายเดือนก่อน

    It was best...for django rest api Authentication ❤❤❤

  • @davidantassoares3683
    @davidantassoares3683 2 ปีที่แล้ว

    Awesome video, helped me out a lot 😃

  • @akashdudhade8239
    @akashdudhade8239 ปีที่แล้ว

    bro Thank you...u are genious.

  • @prabump9746
    @prabump9746 2 ปีที่แล้ว

    Nice video

  • @berroubamohamedelamine8667
    @berroubamohamedelamine8667 2 ปีที่แล้ว

    Thanks a lot 😊

  • @samuelkocur9076
    @samuelkocur9076 2 ปีที่แล้ว +3

    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

  • @franckdefo3112
    @franckdefo3112 8 หลายเดือนก่อน

    thanks very much

  • @devbazregari8879
    @devbazregari8879 ปีที่แล้ว

    tnx bro

  • @tompatrickhankz2244
    @tompatrickhankz2244 2 ปีที่แล้ว

    My Login route is nt returning user details... Its Say ReturnDict' object is not callabe

  • @stackheap6916
    @stackheap6916 ปีที่แล้ว

    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?

  • @nonsense23s1as21a
    @nonsense23s1as21a 11 หลายเดือนก่อน

    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..

  • @nilesh_ahir4500
    @nilesh_ahir4500 2 ปีที่แล้ว

    what is meaning of knox in django?

  • @lolitalolita5290
    @lolitalolita5290 2 ปีที่แล้ว +1

    Do you have any video login in with dja go rest api and volley ?

  • @ifeanyielemson927
    @ifeanyielemson927 2 ปีที่แล้ว

    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.

    • @AlbertDevshot
      @AlbertDevshot  2 ปีที่แล้ว

      You can try the @csrf_exempt decorator

  • @dipuometuel6806
    @dipuometuel6806 11 หลายเดือนก่อน +1

    cant login other users except for the admin......."non_field_errors": [
    "Unable to log in with provided credentials."
    ]

    • @anitaachu4957
      @anitaachu4957 11 หลายเดือนก่อน

      Where you able to resolve this?

  • @RahulGupta-pw5ei
    @RahulGupta-pw5ei ปีที่แล้ว

    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

  • @rameshbabu2036
    @rameshbabu2036 2 ปีที่แล้ว

    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

  • @YnwA319
    @YnwA319 ปีที่แล้ว

    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.