简体   繁体   English

Django 调试工具栏的 Javascript 问题

[英]Javascript issue with Django Debug toolbar

I am currently building an application with Django and using the Django Debug Toolbar to optimize it.我目前正在使用 Django 构建应用程序并使用Django 调试工具栏对其进行优化。

When I run my application (with DEBUG = True , in my dev environment), I frequently (but not always...) get the following JavaScript error ( toolbar.js :227):当我运行我的应用程序(在我的开发环境中使用DEBUG = True )时,我经常(但不总是......)收到以下 JavaScript 错误( toolbar.js :227):

未捕获的类型错误:djDebug.querySelector 不是 HTMLDocument.init (toolbar.js:217) 的 Object.hide_toolbar (toolbar.js:236) 的 Object.hide_panels (toolbar.js:227) 的函数

Because of that, the toolbar does not appear correctly.因此,工具栏无法正确显示。 I am using Django 3.0 and the django-debug-toolbar 2.1 (and Chrome 80.0.3987).我正在使用Django 3.0django-debug-toolbar 2.1 (和 Chrome 80.0.3987)。

Any help appreciated.任何帮助表示赞赏。 Thank you in advance.先感谢您。

Do you have the debugger javascript loaded somewhere on your page?您是否在页面上的某处加载了调试器 javascript?

<script type="text/javascript" src="{{ STATIC_URL }}debugtools/jquery.debug.js"></script>

from the docs: https://pypi.org/project/django-debugtools/来自文档: https : //pypi.org/project/django-debugtools/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM