[Answered ]-How to get username of request from ModelViewSet class in Django rest API?

2👍

If you want to add the user to the Photo instance, either use the CurrentUserDefault in the PhotoSerializer (as read-only field) or pass the user to the serializer’s save within the view’s perform_create

Leave a comment