ImportError with --autogenerate
I've got a very simple sqlalchemy project all living in 1 file (for now), including my Base object. I am interested in autogenerating migrations for this project.
As the tutorial specifies, I have imported the project file in env.py and set target_metadata to point at Base.metadata in the imported module. It is giving me an ImportError on the module name, however. To clarify, all my code is in foo.py. env.py has two lines looking like:
from foo import Base target_metadata = Base.metadata
Then when I run:
alembic revision --autogenerate -m "add initial revision"
ImportError: No module named foo
What am I doing wrong, if anything?