1👍
✅
Problem in your urls, you need to close r'users/$
, because Django can’t go further users/
without $
And why you use ListAPIView
for retrieving single object?
You need RetrieveAPIView
or RetrieveUpdateAPIView
if you want change the data. And change your view like so:
class UserDetail(RetrieveAPIView):
lookup_field = 'username'
queryset = User.objects.all()
You don’t need get_queryset
at all
Source:stackexchange.com