Python 3, Django 1.8.5, Postgres
I have a model Sites
that has been working fine. I recently tried to add a field, airport_code, and migrate the data.>
Late to the party, but there is some info I want to share. It helped me a lot! :)
I am using django-solo to store app config in database, and I got the same issue as Alex when adding new field to configuration model. Stacktrace pointed me to the line where I'm getting config from database: conf = SiteConfiguration().get_solo()
.
There is a closed issue for django-solo project on Github. The idea is to make model loading lazy (exactly as MrKickkiller pointed before).
So for modern Django version (in my case 3.0) this code works perfectly:
from django.utils.functional import SimpleLazyObject
conf = SimpleLazyObject(SiteConfiguration.get_solo)