I am building a django app with a MySQL DB. When I run \'python manage.py migrate\' for the first time, some tables are created well then some errors appear. The error broug
Ran into a similar situation whereby there's
django.db.utils.OperationalError: (1824, "Failed to open the referenced table 'auth_user'")
at first, which I resolved by making sure I have all the migrations done properly, every app has its corresponding migrations folder and also __init__.py file within it.
After which I had the similar issue with another table in the database that raised another error and that's preventing me from starting the test. I solved it by removing all the records in django_migrations table, deleting all the migration files (if you are ok with it). Then I run
python manage.py makemigrations
python manage.py migrate --fake
All the nonsense of the migrations dealt with :)