[Answered ]-Why does Django Rest Framework try to authenticate the request?

2👍

It’s not trying to authenticate the request. You don’t have any authenticators so it skipped over an empty tuple and went to:

352.         self._not_authenticated()

However the unauthenticated user object in rest framework defaults to this:

# Authentication
'UNAUTHENTICATED_USER': 'django.contrib.auth.models.AnonymousUser',

So maybe you’ll need to provide your own unauthenticated user model, if you don’t want to pull in django.contrib.auth.

👤wim

Leave a comment