Kar*_*hik 5 python-3.x gunicorn plotly-dash
我想在 Gunicorn 上部署一个 dash 应用程序。但我不能这样做。当我执行以下命令时,我在屏幕上没有看到任何错误gunicorn <module_name>:<variable_name>
版本:
\n我的破折号应用程序,文件名:analyzer.py
import dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport pandas as pd\nimport flask\n\n<data_frame definitions>\n\n\napp = dash.Dash()\nserver = app.server\n\n<app.layout>\n\n<Call backs>\n\n## at the end\n\nif __name__ == '__main__':\n app.run_server()\nRun Code Online (Sandbox Code Playgroud)\n当我使用以下命令时,我在屏幕上看不到任何错误,但我仍然可以\xe2\x80\x99t从浏览器访问该应用程序。
\n[user1@myHost]$ gunicorn analyzer:server -b:8000\n\n[2021-04-16 16:57:58 +0200] [8334] [INFO] Starting gunicorn 20.0.4\n[2021-04-16 16:57:58 +0200] [8334] [INFO] Listening at: http://0.0.0.0:8000 (8334)\n[2021-04-16 16:57:58 +0200] [8334] [INFO] Using worker: sync\n[2021-04-16 16:57:58 +0200] [8345] [INFO] Booting worker with pid: 8345\nRun Code Online (Sandbox Code Playgroud)\n我看到该端口正在侦听,但是,我无法在服务器 \xe2\x80\x99s 公共 IP 和 0.0.0.0\n端口 8000 处于侦听模式下打开我的仪表板
\nsudo lsof -i -P -n | grep LISTEN\n\ngunicorn 13003 user1 5u IPv4 49878669 0t0 TCP *:8000 (LISTEN)\ngunicorn 13015 user1 5u IPv4 49878669 0t0 TCP *:8000 (LISTEN)\nRun Code Online (Sandbox Code Playgroud)\n你能告诉我哪里出错了吗?
\n当服务器被告知监听时0.0.0.0,这意味着“监听所有绑定的 IP 地址”。浏览器可以使用绑定到该服务器的任何 IP 地址来访问它。地址族127是保证绑定到每台机器的地址集之一。
这意味着您应该能够浏览https://127.0.0.0:8000以查看该网络应用程序。还有https://127.0.0.1:8000,,,,等等https://127.0.1.0:8000。https://127.666.312.432:8000
然而,要求网络浏览器访问https://0.0.0.0意味着“我不知道我想连接到哪里”并且总是失败。这包括所有端口,因此尝试浏览https://0.0.0.0:8000总是会失败。
| 归档时间: |
|
| 查看次数: |
6103 次 |
| 最近记录: |