You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't quite understand what is going wrong. The error raised mentions adding a context keyword when I instantiate the serializer; however I have no clue on why it would need the request or where to instantiate.
Any help would be greatly appreciated as I'm completely lost on how to fix this issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I am trying to use a websockets to send a queryset to my frontend using a model serializer.
When I test this out I receive the following message:
"HyperlinkedIdentityField" requires the request in the serializer context. Add
context={'request': request}when instantiating the serializer.
This is my frontend test code:
This is my serializer:
This is my consumer:
I don't quite understand what is going wrong. The error raised mentions adding a context keyword when I instantiate the serializer; however I have no clue on why it would need the request or where to instantiate.
Any help would be greatly appreciated as I'm completely lost on how to fix this issue.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions