我收到以下错误:
ValueError: The default Firebase app already exists. This means you called initialize_app() more than once without providing an app name as the second argument. In most cases you only need to call initialize_app() once. But if you do want to initialize multiple apps, pass a second argument to initialize_app() to give each app a unique name.
如何检查默认的 firebase 应用程序是否已在 python 中初始化?
原文由 sadhna 发布,翻译遵循 CC BY-SA 4.0 许可协议
最好的方法是控制您的应用程序工作流程,以便仅调用一次初始化。但当然,幂等代码也是一件好事,因此您可以采取以下措施来避免该错误: