【问题标题】:Streamlit blocked asking for credentialsStreamlit 阻止请求凭据
【发布时间】:2021-12-01 08:34:57
【问题描述】:

我正在尝试将 Streamlit 应用程序部署到 Windows。我设法设置了所有环境和依赖项并开始使用(有关我如何部署应用程序的详细信息,请参阅this question)。但它会立即阻止请求凭据。

这是日志:

  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 上那样自动启动,显示可以访问应用的地址?有没有一种无需用户额外配置即可启动应用的方法?

【问题讨论】:

    标签: python windows streamlit


    【解决方案1】:

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

    完整的anwser here.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-24
      • 2015-02-16
      • 1970-01-01
      • 2018-06-21
      • 2019-10-26
      • 2017-07-23
      • 1970-01-01
      • 2017-12-15
      相关资源
      最近更新 更多