Django migrations directories cannot be namespace packages

Django's migrate command locates migration files for an app by loading a subpackage of the app, named migrations, and then searching that subpackage for modules.

Unfortunately, there's a check in the code that does not allow migrations to be a namespace package. In other words, it must contain an __init__.py. So if, like us, you upgraded to Python 3 and then gleefully deleted all your empty __init__.py files, you'll have to add them back to your migrations directories.  

Show Comments