Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"django.db.utils.ProgrammingError: relation "auth_user" does not exist" Django V2.0

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?

like image 709
DariusFontaine Avatar asked Mar 26 '18 14:03

DariusFontaine


2 Answers

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.

like image 108
Lake Hu Avatar answered Nov 02 '22 00:11

Lake Hu


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!

like image 4
Mykola Rudenko Avatar answered Nov 02 '22 00:11

Mykola Rudenko