I am using allauth for authentication in drf. I was able to register new users and login with the credentials. The login api return response something like this:
{
"key" : "<some token>"
}
Now I have 1 more API the code for which is
from django.http import HttpResponse
def lol(request):
if request.user.is_authenticated:
return HttpResponse("Authenticated")
else:
return HttpResponse("Not Authenticated")
But this is always returning not authenticated
my api call look like this
Here is the list of installed apps in my settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'rest_auth',
'django.contrib.sites',
'allauth',
'allauth.account',
'rest_auth.registration',
'api.user',
'api.activity',
]