Django Rest Framework debug post and put requests

前端 未结 4 1673
迷失自我
迷失自我 2021-02-19 12:02

I use DRF extension to se json list for model, and there i can debug with debug-toolbar that GET request, but how can i debug POST and

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 12:43

    When debugging interactively on a local machine, I like to examine the request data by breaking in the relevant put() or post() method in rest_framework.generics.

    For quick local debugging of POST or PUT validation errors (e.g. in case of http status 400 issues), I like to break at the end of Field.run_validators() in rest_framework.fields and examine the error messages there.

提交回复
热议问题