我正在尝试将django-channels合并到我的下一个项目中,但我在调试时遇到了问题。我已经尝试了pycharms调试器和pdb,但它没有命中断点。
发布于 2016-10-19 02:42:58
看看django channels面板。它是django debug toolbar的一个插件。您可以向其中添加django- channel -panel,以将通道调试功能添加到您的项目中。这确保了当你的应用程序处于开发模式时,你可以传送详细信息。
https://github.com/Krukov/django-channels-panel
Installation Django调试工具栏
pip install django-debug-toolbar
在settings.py中
INSTALLED_APPS = [
# ...
'django.contrib.staticfiles',
# ...
'debug_toolbar',
]
MIDDLEWARE = [
# ...
'debug_toolbar.middleware.DebugToolbarMiddleware',
# ...
]在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)),
]配置
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',
]Installation 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发布于 2018-01-15 02:29:08
将PYCHARM_DEBUG=True添加到环境变量为我解决了这个问题。
这会在运行调试器时添加许多要输出的额外日志记录,但是即使在从配置中删除PYCHARM_DEBUG值之后,问题似乎仍然得到解决。
发布于 2019-10-23 16:21:09
这是目前对我有效的方法:
在Python调试设置中,确保未勾选Gevent-compatible
我不认为其他任何事情都是必要的。我的断点在此设置更改后命中,但在勾选Gevent-compatible时不命中。
https://stackoverflow.com/questions/39458513
复制相似问题