12

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?

4
  • Is that a new application or you are updating Django in a pre-existing project? Commented Mar 26, 2018 at 14:23
  • New application, for various reasons I'd rather not downgrade Commented Mar 26, 2018 at 14:24
  • 1
    I am using Django 2.0 for about 6 weeks and I didn't get this problem. I am using Postgres and sqlite3 in different projects. My env is python 3.6.2 if it helps Commented Mar 26, 2018 at 14:27
  • That's what I'm using as well. However this error only occurs when I try to use PostGres Commented Mar 26, 2018 at 15:04

3 Answers 3

6

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.

Sign up to request clarification or add additional context in comments.

Comments

5

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!

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.