How to import the own model into myproject/alembic/env.py?

You can set the PYTHONPATH environment variable to control what python sees as the top level folder, eg. if you are in the root folder of your project:

PYTHONPATH=. alembic revision -m "..."

Then you can use a “normal” import in your alembic env.py, relative to your root folder, in your example:

from src.models.base import Base

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)