bdragon300 / mongoengine-migrate

Migrations for MongoEngine inspired by Django
Apache License 2.0
17 stars 5 forks source link

Programatically add PYTHONPATH=. as one of the first thing in the code #21

Closed dameyerdave closed 3 years ago

dameyerdave commented 3 years ago

Because mongoengine_migrate makemigrations is used in the scope of the current project (directory) it would make sense to add the current directory (.) to the PYTHONPATH. Otherwise I always get the error

mongoengine_migrate makemigrations -m models.data
...
ModuleNotFoundError: No module named 'models'

As a workaround I call it like this

PYTHONPATH=. mongoengine_migrate makemigrations -m models.data
bdragon300 commented 3 years ago

Fixed in dev branch