How can I have the django message framework work with the rest_framework?
Here is my view
@api_view(['GET', 'POST'])
def myview(request):
if request.method == 'GET':
#return a Response object
else:
#process post data
messages.success(request, 'Success')
return Response(response)
I encounter the following error
add_message() argument must be an HttpRequest object, not 'Request'
which is because the rest_framework
does not use the normal HttpRequest
object, used
in django by default.
How can I use messaging framework with rest framework?