如何在调试模式下自动启动PyCharm的Django服务器?

时间:2019-11-21 12:42:18

标签: python django debugging pycharm

我正在尝试在IDE启动时自动启动Django服务器。简单的Run命令可以正常工作,但是当我尝试将调试器参数复制到python interpreter options字段时,出现以下错误:

Could not connect to 127.0.0.1: 36771

Traceback (most recent call last):
  File "/opt/pycharm-2019.2.3/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 449, in start_client
    s.connect((host, port))
ConnectionRefusedError: [Errno 111] Connection refused

Traceback (most recent call last):
  File "/opt/pycharm-2019.2.3/helpers/pydev/pydevd.py", line 2073, in <module>
    main()
  File "/opt/pycharm-2019.2.3/helpers/pydev/pydevd.py", line 1958, in main
    dispatcher.connect(host, port)
  File "/opt/pycharm-2019.2.3/helpers/pydev/pydevd.py", line 1775, in connect
    self.client = start_client(self.host, self.port)
  File "/opt/pycharm-2019.2.3/helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 449, in start_client
    s.connect((host, port))

ConnectionRefusedError: [Errno 111] Connection refused

Process finished with exit code 1

简单运行命令: /home/ez/project/venv/bin/python3.7 /home/ez/project/manage.py runserver 8000

调试命令: /home/ez/project/venv/bin/python3.7 /opt/pycharm-2019.2.3/helpers/pydev/pydevd.py --multiproc --qt-support = auto- -client 127.0.0.1 --port 36771 --file /home/ez/project/manage.py runserver 8000

Copypaste debug parameters to simple run interpreter options

我在做什么?如何手动运行调试?

0 个答案:

没有答案