I am building a project in Django Rest Framework where users can login to view their wine cellar. My ModelViewSets were working just fine and all of a sudden I get this frus
Because it's a HyperlinkedModelSerializer
your serializer is trying to resolve the URL for the related User
on your Bottle
.
As you don't have the user detail view it can't do this. Hence the exception.
UserViewSet
with the router solve your issue?BottleSerializer
to explicitly use the UserSerializer
rather than trying to resolve the URL. See the serializer docs on dealing with nested objects for that.