Robot
Robot

Reputation: 135

How to print post request data in django

In PHP when I send post request data from template form to controller I can use print_r($data) to print form send data for debugging purpose but in Django how can I print post request form data in view.py

Upvotes: 6

Views: 12790

Answers (1)

Antu
Antu

Reputation: 2303

If you get your form data like PHP you may use

from django.http import HttpResponse

return HttpResponse(request.POST.items())

And for more debuging follow this Link

Upvotes: 17

Related Questions