I know how to run commands with PyCharm (Tools -> Run manage.py Task), but I would like to debug them also, including my commands and third party app's commands.
I know how to run commands with PyCharm (Tools -> Run manage.py Task), but I would like to debug them also, including my commands and third party app's commands.
通过在运行/调试配置菜单上创建自定义Django服务器条目,可以在PyCharm中调试自定义Django admin/management命令:
Edit Configurations...
.Django server
.Name
就填,清除Host
和Port
栏,
选中Custom run command
并将命令名称输入到
复选框的右侧.Additional options
中输入任何额外的命令行参数,而不是附加在运行命令中. 现在设置一个断点,从Run/Debug configuration菜单中 Select 您的新配置,然后单击Debug按钮.瞧啊!