#StackBounty: #django #http #logging #django-rest-framework #gunicorn How to log requests and responses in Django?

Bounty: 50

How can I log all my requests and responses (headers and body) in Django using a middleware?
I’m using Django 2.2 with Django rest framework, so sometimes the requests and responses are original Django type, sometimes of drf.
The app is served behind gunicorn.
I’ve developed middleware but the main problem is I can’t read request’s body twice as it gives me error.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.