Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aerich init-db Error: No config named "src.settings" #95

Closed
Chise1 opened this issue Nov 28, 2020 · 4 comments
Closed

aerich init-db Error: No config named "src.settings" #95

Chise1 opened this issue Nov 28, 2020 · 4 comments

Comments

@Chise1
Copy link

Chise1 commented Nov 28, 2020

When I implemented "aerich init-db",I got an error:No config named "src.settings"
I'm sure my aerich.ini was true.

aerich.ini
[aerich]
tortoise_orm = src.settings.TORTOISE_ORM
location = ./migrations

.This is my folder tree:

├── aerich.ini
├── migrations
├── poetry.lock
├── pyproject.toml
├── src
│   ├── main.py
│   ├── models
│   │   └── init.py
│   └── settings.py
└── tests
└── init.py

@Chise1
Copy link
Author

Chise1 commented Nov 28, 2020

TORTOISE_ORM = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.mysql",
            "credentials": {
                "host": DB_HOST,
                "port": DB_PORT,
                "user": DB_USER,
                "password": DB_PASSWORD,
                "database": DB_NAME,
                "echo": os.getenv("DB_ECHO") == "True",
                "maxsize": 10,
            },
        },
    },
    "apps": {
        "models": {
            "models": ["src.models", "aerich.models", ],
            "default_connection": "default",
        },
    },
}

@long2ice
Copy link
Member

Did you run in project root dir?

@Chise1
Copy link
Author

Chise1 commented Nov 29, 2020

Yes.
My system is deepin v20. python version is 3.7 .

(fastapi-template-cu81P5JZ-py3.7) chise@chise-PC:~/PycharmProjects/fastapi_template$ aerich init-db
Usage: aerich [OPTIONS] COMMAND [ARGS]...
Try 'aerich -h' for help.

Error: No config named "src.settings"
(fastapi-template-cu81P5JZ-py3.7) chise@chise-PC:~/PycharmProjects/fastapi_template$ 

@long2ice
Copy link
Member

That's confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants