Streamlit 被阻止要求凭据

Streamlit blocked asking for credentials

我正在尝试将 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:

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

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

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

完整答案