Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

South does not recognize models when it is a package

I use South for schema and data migraton for my Django site. I'm happy about using it. One day I converted models.py file to models/__init__py and put some additional models at models/something.py. When I ran python manage.py schemamigration app --auto, I got the Nothing seems to have changed. message despite of the new classes at something.py. If I copied them to the __init__py file, South had recognized the new models. I tried to import everything from something in the top of __init__py, but no change.

like image 800
viam0Zah Avatar asked Sep 19 '10 18:09

viam0Zah


1 Answers

It's Django design. Django is not picking your models at all, you need to set app_label in your model's Meta class.

See ticket on Automatically discover models within a package without using the app_label Meta attribute.

like image 165
iElectric Avatar answered Dec 04 '22 17:12

iElectric