Print HTTP request in Python Django
django, python
Solution
You can use Django Debug Toolbar which allows you to view a lot of debugging information including request and session.
From its documentation:
Currently, the following panels have been written and are working:
- Django version
- Request timer
- A list of settings in settings.py
- Common HTTP headers
- GET/POST/cookie/session variable display
- Templates and context used, and their template paths
- SQL queries including time to execute and links to EXPLAIN each query
- List of signals, their args and receivers
- Logging output via Python's built-in logging, or via the logbook module
Problem
I want to print the entire request object that comes to the server. I need to see all of the parameters that the request carries from the client since I don't have the clients's code (it's an Android client). I'm in the view.py file, and I'm using the function ``` def index(request): return HttpResponse("test params") ``` to print the request object Please suggest code. It would be even better if I can print the request in the browser and not in the console.