[Django]-Django Rest Framework IsAuthenticated permission Error Anonymous user

0👍

The @permission_classes is for identifying if the api needs authentication. If you want to use token, try to add @authentication_classes with TokenAuthentication inside. This will check the token in your header and create the user object inside request.

👤CJ Hu

0👍

Use this:

permission_classes = [permissions.IsAuthenticated,]

It worked for me.

👤Nonso

Leave a comment