I want to create a many-to-many relationship where one person can be in many clubs and one club can have many persons. I added the models.py and
many-to-many
models.py
Following MDT's response, I use django-rest-framework, and solve it by changing request to request._request.
serializer_context = {'request': Request(request._request)}