Flask-Dance:没有名为 'flask_dance.consumer.backend' 的模块

Flask-Dance: No module named 'flask_dance.consumer.backend'

这是我的第一个问题,请不要吃我!我完全是新手,出于 OAuth 的原因,我尝试使用 flask-dance 编写一个 flask 应用程序。似乎我做了一些愚蠢的事情,因为当我尝试 import SQLAlchemyBackend class from flask_dance.consumer.backend.sqla Python returns

ModuleNotFoundError: No module named 'flask_dance.consumer.backend'

你能告诉我我到底做错了什么吗?

我为 SQLAlchemy 数据库使用 flask-dance[sqla] 版本。首先我安装了没有 SQLAlchemy 支持的基本版本,然后我卸载了它并安装了当前版本(都在 venv 中)。这是否可能影响 F-D 功能及其自身的模块和子模块方案?

我不知道如何解决这个问题以及去哪里。 Google 也无济于事。

我在引用中看到的是:

Traceback (most recent call last):   File "c:\users\igor\envsdo2\lib\site-packages\flask\cli.py", line 235, in locate_app
    __import__(module_name)   File "C:\Users\igor\projects\gpdo2\app\app.py", line 8, in <module>
    from flask_dance.consumer.backend.sqla import SQLAlchemyBackend ModuleNotFoundError: No module named 'flask_dance.consumer.backend'

Flask-Dance 1.4.0, "backends" were renamed to "storages", since the word "backend" means something different in the context of web development. This change was backwards-compatible in 1.4.0, but the backwards-compatibility features were dropped in Flask-Dance 2.0.0.

要在 Flask 2.0 及更高版本中实现此功能,只需将单词 "backend" 替换为单词 "storage" 即可。比如这行代码:

from flask_dance.consumer.backend.sqla import SQLAlchemyBackend

改为:

from flask_dance.consumer.storage.sqla import SQLAlchemyStorage

如果您在 current documentation 中看到任何对 "backends" 的引用,请告诉我!他们现在应该都"storages"了。