最佳答案
I am currently developing an API using Django.
However, I would like to create a view that returns the current User with the following endpoint: /users/current/
.
To do so, I created a list view and filtered the queryset on the user that made the request. That works, but the result is a list, not a single object. Combined with pagination, the result looks way too complicated and inconsistent compared to other endpoints.
I also tried to create a detail view and filtering the queryset, but DRF complains that I provided no pk or slug.