0

我对 aerich 配置有疑问:

我有app/database.py包含下一个内容的文件:

TORTOISE_ORM = {
    "connections": {"default": "postgres://..."},
    "apps": {
        "models": {
            "models": ["app.models", "aerich.models"],
            "default_connection": "default",
        },
    },
}

我还有一个带有龟表的 python 包,位于app/models/.... 我正在尝试使用以下命令创建第一个迁移文件:

  1. aerich init -t app.database.TORTOISE_ORM我正在我的内部获取数据pyproject.toml
[tool.aerich]
tortoise_orm = "app.database.TORTOISE_ORM"
location = "./migrations"
src_folder = "./."
  1. 之后我尝试运行aerich init-db,但出现错误:tortoise.exceptions.ConfigurationError: Module "app.models" not found 我尝试了很多不同的变体来更改此配置,但得到相同的错误。aerich版本==^0.6.2

大家知道怎么回事吗?

4

0 回答 0