基础知识:
我有一个Django项目运行良好(在本地和远程服务器上)。
我在本地使用“远程调试”配置文件启动pycharm,它看起来很好。

Starting debug server at port 4000
Use the following code to connect to the debugger:
import pydevd
pydevd.settrace('<my local machines public ip addr>', port=4000, suspend=False)
Waiting for connection...

在远程服务器上,我在
__init__.py
中对pycharm-debug.egg进行了适当的调用(但我也尝试将其放在代码中的其他位置)。
我像这样启动远程服务器,在本地pycharm ide/debugger上,我看到:
"Connected to pydev debugger (build 133.1347)"

在这之后,事情就这样…我没有得到任何关于执行位置的反馈,也没有Pycharm IDE中“启动/继续/运行”任何内容的能力。
在远程服务器上,如果我
python manage.py runserver <remote domain name>:8000
it,我会看到:
File "/<path here>/pycharm-debug.egg/pydevd.py", line 1256, in settrace
File "/<path here>/pycharm-debug.egg/pydevd.py", line 1305, in _locked_settrace

我的猜测是,所有的东西都连接得很好,但是我看不到一种启动所有东西的方法。我有“suspend=false”,所以我希望它能开始。当我试图打开一个针对远程服务器的页面时,我会得到“未连接”,因此Web服务器显然还没有运行(如果
<ctrl-c>
i get
curl http://<remote server domain>:8000
)。如果没有远程调试,这在本地开发人员计算机或远程服务器上都可以正常运行。
我做错什么了?:)谢谢!
细节:
在运行代码/进程的远程服务器上,我希望在main
curl: (7) Failed connect to <remote server domain>:8000; Connection refused
中进行调试,我有:
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.append(BASE_DIR + '/pycharm-debug.egg')
import pydevd
pydevd.settrace('<my local machines public ip addr>', port=4000, suspend=False)

本地Pycharm IDE显示:
Starting debug server at port 4000
Use the following code to connect to the debugger:
import pydevd
pydevd.settrace('localhost', port=4000, suspend=False)  (tried with <public ip addr> for this, too.
Waiting for connection...
---- and then, after I start the remote server process: ----
Connected to pydev debugger (build 133.1347)

其他说明:
我在远程服务器上尝试过使用和不使用virtualenv。
我在一个普通的康卡斯特电缆调制解调器路由器后面运行本地Pycharm IDE,端口4000的端口转发已打开(并在连接到端口4000的节点服务器上进行了测试,当我从远程服务器对其执行wget时,该服务器工作正常)。
我对如何“碰撞”任何东西以使事情运行和让我开始调试感到困惑。
谢谢你的帮助。

最佳答案:

/usr/local/bin/python/home//.pycharm_helpersDJANGO_SETTINGS_MODULE = /settings.pyHTTPS=1/home////Users/JohnQ//=/home////