Reputation: 794
I've recently upgraded Django to V2.0 and I'm unable to make migrations due to the following error:
django.db.utils.ProgrammingError: relation "auth_user" does not exist
I know a similar bug existed in V1.8 which I fixed by migrating the model which others depend on, i.e. auth_user and then the rest:
python manage.py migrate auth
python manage.py migrate
When I try to migrate 'auth' I encounter the same error. Has anybody encountered/found a solution to this?
Upvotes: 11
Views: 17621
Reputation: 492
I ran into the same problem after I upgraded my DB with new/removed apps and forgot to upgrade my asgi.py
and wsgi.py
files to point to the upgraded settingsprod.py
(for anyone who was following along with the eCommerce CodingWithStein). I then had to restart my nginx and gunicorn services.
Upvotes: 0
Reputation: 314
I have same issue even after creating new database. What helped me, is choosing another owner, when creating new DB, not postgress owner. Also I was using
py manage.py migrate myapp
with this command, I have the same issue as well But when I tried use
py manage.py migrate
and change owner from postgress on DB creating, it helped!
Upvotes: 5
Reputation: 116
I encountered the same error.
At last I found the root cause was the database.
There may be some auth info in the database already.
Editing setting.py and using another new database will solve this problem.
Upvotes: 6