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 __str__ returned non-string (type NoneType)
- Django & Amazon SES SMTP. Cannot send email
- Django check user group permissions
- Django restrict pages to certain users
- UnicodeEncodeError with attach_file on EmailMessag
相关文章
- pycharm上传代码到github,为什么不能指定某一个项目,而是默认上传第一个项目
- Profiling Django with PyCharm
- Why doesn't Django enforce my unique_together
- MultiValueDictKeyError in Django admin
- Django/Heroku: FATAL: too many connections for rol
- How to fix this strange error: “RuntimeError: CUDA
- Django is sooo slow? errno 32 broken pipe? dcramer
- Pycharm Edu 无法运行代码
Since clearing Host and Port will not make the command run at all (PyCharm 5), the solution I found is to use a Python run configuration instead of a Django server. Fill
Script
with your manage.py script, other parameters inScript Parameters
, and adjust your environment such asWorking directory
.After installing ipdb (pip install ipdb) put those lines to debug point:
https://pypi.python.org/pypi/ipdb
You can debug a custom Django admin/management command in PyCharm by creating a custom Django server entry on the Run/Debug Configuration menu:
Edit Configurations...
.Django server
.Name
as you please, clear theHost
andPort
fields, checkCustom run command
and enter the name of your command to the right of the checkbox.Additional options
, not appended in the run command.Now set a breakpoint, choose your new configuration from the Run/Debug Configuration menu and click the Debug button. Et voilà!