Questions: 1 - have you created a login view to retrieve the token? 2- in your request, from client, are you sending the token returned above within the header?
The flow is: 1 - authenticate user 2 - get the token 3 - send the token in header for every request Em sáb, 30 de nov de 2019 17:04, Yery cs <[email protected]> escreveu: > Hello, Thanks for your reply. >> >> I have already checked this github comments. > I added custom middleware in settings middlewares after Authentication > middleware. > But I got still Anonymous user. > About test, can you explain about force_login? > About project status, I am printing logs in console like `print > (request.user)` in middleware. > Console says `AnonymousUser`. > How can I fix it? > Thank you. > > -- > You received this message because you are subscribed to the Google Groups > "Django REST framework" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-rest-framework/db4aad44-1b01-45ed-932b-cc0151bc1105%40googlegroups.com > <https://groups.google.com/d/msgid/django-rest-framework/db4aad44-1b01-45ed-932b-cc0151bc1105%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/CA%2Ba7aJ33WL%2BWcBKoFL5KUP4heZmSZhYnQbrBR_tX8HVsaMmw_g%40mail.gmail.com.
