How to migrate models from a models package hierar

2019-07-26 08:27发布

问题:

Hy!

I have my models in a hierarchy below "models" package:

 models
 |-a.py
 |-b.py

instead of having all my models into the models.py

But when I run the migration command for South it doesn't find any of them:

schemamigration my_app --auto

In the meta class already exists the app_label='my_app'

I use auto because the tables are already changed.

回答1:

Have you imported all the models in __init__.py? If you've done that, there's effectively no difference in how it works.