I'm trying to use the django messages framework to show messages after ModelViewSet.create()
:
class DomainModelViewSet(ModelViewSet):
def create(self, request):
super(DomainModelViewSet, self).create(request)
messages.success(self.request, "Domain Added.")
return HttpResponseRedirect(reverse('home'))
But I get:
TypeError: add_message() argument must be an HttpRequest object, not 'Request'.
So, how can use the Django HttpRequest
from django rest framework Request
?