Man*_*tis 6 django pycharm django-channels
我正在尝试将django-channels合并到我的下一个项目中,但我遇到调试问题.我已经尝试过pycharms调试器和pdb,但它没有遇到断点.
查看 django 通道面板。它是django 调试工具栏的插件,尽管它不支持通道 2.0,并且该项目于 2020 年 9 月 28 日存档。
您可以将 django-channels-panel 添加到此,以向您的项目添加通道调试功能。这确保您可以在应用程序处于开发模式时传递详细信息。
https://github.com/Krukov/django-channels-panel
安装[ Django 调试工具栏 ]
pip install django-debug-toolbar
在设置.py
INSTALLED_APPS = [
# ...
'django.contrib.staticfiles',
# ...
'debug_toolbar',
]
MIDDLEWARE = [
# ...
'debug_toolbar.middleware.DebugToolbarMiddleware',
# ...
]
Run Code Online (Sandbox Code Playgroud)
在 urls.py 中
from django.conf import settings
from django.conf.urls import include, url
if settings.DEBUG:
import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)),
]
Run Code Online (Sandbox Code Playgroud)
配置
DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.versions.VersionsPanel',
'debug_toolbar.panels.timer.TimerPanel',
'debug_toolbar.panels.settings.SettingsPanel',
'debug_toolbar.panels.headers.HeadersPanel',
'debug_toolbar.panels.request.RequestPanel',
'debug_toolbar.panels.sql.SQLPanel',
'debug_toolbar.panels.staticfiles.StaticFilesPanel',
'debug_toolbar.panels.templates.TemplatesPanel',
'debug_toolbar.panels.cache.CachePanel',
'debug_toolbar.panels.signals.SignalsPanel',
'debug_toolbar.panels.logging.LoggingPanel',
'debug_toolbar.panels.redirects.RedirectsPanel',
]
Run Code Online (Sandbox Code Playgroud)
安装[Django通道面板]
pip install django-channels-panel
add 'channels_panel' to your INSTALLED_APPS in settings.py
add 'channels_panel.panel.ChannelsDebugPanel' to your DEBUG_TOOLBAR_PANELS
Run Code Online (Sandbox Code Playgroud)