Django Rest Framework调试发布和放置请求 [英] Django Rest Framework debug post and put requests

查看:57
本文介绍了Django Rest Framework调试发布和放置请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用DRF扩展名来获取模型的json列表,并且可以使用 GET 请求的 debug-toolbar 进行调试,但是如何调试 POST PUT 请求?

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 PUT requests?

在调试模式下,我具有以下设置:

I have this for settings in debug mode:

INSTALLED_APPS += ('debug_toolbar',)

MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)

DEBUG_TOOLBAR_PATCH_SETTINGS = False
INTERNAL_IPS = (
    '127.0.0.1'
)

现在,当我在debug-toolbar中尝试使用 Intercept redirects 时,当我执行 POST 时,它不会向我显示工具栏.

Now, when i try with Intercept redirects in debug-toolbar, it doesn't show me toolbar when i do POST.

推荐答案

我找到了 django-silk 来调试DRF.

I found django-silk for debugging DRF.

https://github.com/django-silk/silk/

这篇关于Django Rest Framework调试发布和放置请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆