Streamlit阻止请求凭据



我正在尝试部署一个流光应用程序到Windows。我设法设置了所有的环境和依赖项,并启动了它(关于我如何部署应用程序的详细信息,请参阅这个问题)。但是它会立即阻止请求凭据。

这是日志:

Welcome to Streamlit!
If you're one of our development partners or you're interested in getting
personal technical support or Streamlit updates, please enter your email
address below. Otherwise, you may leave the field blank.
Email:
2021-10-11 20:56:53.202 WARNING streamlit.config:
Warning: the config option 'server.enableCORS=false' is not compatible with 'server.enableXsrfProtection=true'.
As a result, 'server.enableCORS' is being overridden to 'true'.
More information:
In order to protect against CSRF attacks, we send a cookie with each request.
To do so, we must specify allowable origins, which places a restriction on
cross-origin resource sharing.
If cross origin resource sharing is required, please disable server.enableXsrfProtection.

2021-10-11 20:56:53.202 DEBUG   streamlit.logger: Initialized tornado logs
2021-10-11 20:56:53.202 ERROR   streamlit.credentials:

似乎应用程序的执行被停止,因为它正在等待一些凭据。我在这里发现可以添加.streamlit/credentials.toml,但我不确定在窗口上的确切位置。我还尝试在启动streamlit时显式添加--server.headless=false,但再次没有效果。

为什么应用程序不像Linux那样自动启动,显示应用程序可以访问的地址?有没有一种方法来启动应用程序没有额外的配置由用户?

问题克服了,我错误地将--server.headless配置设置为false。相反,必须是true。要使部署正常工作,还需要另一个参数:--global.developmentMode=false.

完整答案在这里。