The problem
My Django application is supposed to read the tables of an already existing database. So the models of the database are gene...
For further actions, you may consider blocking this person and/or reporting abuse
I've found that this only works when a migration is applied to your database when managed=True has been set for all of your models. In this case, we've fixed the problem of Django not being able to load fixtures into the database to run the tests. But what's the point of going through all this trouble when managed=True the whole time anyway?
Does this make sense or am I missing something?
I found a much simpler method via Vitor's blog at simpleisbetterthancomplex.com/tips... If you put your unmanaged database models in a different app to your managed ones, you can set
MIGRATION_MODULES = {'my_unmanaged_app': None}
in settings.py. All the relevant tables and columns will be created for testing, but no migrations are necessary.
Thanks for taking the time to collect and share this information!
Hey, Paveel!
Do you have a link to the repo? I'm trying to figure out which files to put some of the code in.
Good day Paul
What django version were you using for this?
I am currently on django 2.0.8 and both solutions did not work. I keep getting django.db.utils.OperationalError: no such table
thanks!
Thanks!
Just ran into this problem yesterday and wanted to thank you for the simple solution.