如何在公司内部服务器上部署 Python Dash 应用程序?

How to deploy a Python Dash Application on an internal company server?

我编写了一个 Python Dash 应用程序,它在我的本地计算机上运行良好。现在,我希望能够在公司网络内的服务器上部署此应用程序。我不想在 Heroku 等上部署它,因为数据源是内部 API。如何在服务器上部署此应用程序?这是一台基于 Linux 的机器。

我发现 说使用下面的代码,但不太确定在哪里添加这段代码。

waitress-serve --host=0.0.0.0 --port=8080  appname:app.server

您所指的代码 waitress-serve 是绑定到 Waitress 提供的函数 waitress.serve 的 command-line 包装器。

你 运行 它在你的终端或从 shell 脚本。

Waitress is a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in the Python standard library. It runs on CPython on Unix and Windows under Python 3.7+.

您可以使用 pip install waitress 安装它。

@查看 waitress-serve 文档 here