[Django]-Django.db.utils.ProgrammingError: relation "auth_user" does not exist

2👍

I was having this problem in Django 1.8, where I’m using a custom user profile which I, as recommended in the documentation, created with a OneToOneField to the user.

Luckily, I isolated the user profile code in a separate app which I called “profile”.

For me, this workaround solved the problem:

  • Disable the custom user profile by disabling the “profile” app in settings.py by removing it from INSTALLED_APPS
  • Run python manage.py migrate
  • Re-enable the custom user profile by re-inserting the app.

This is most certainly due to a bug in Django.

1👍

I had very similar issue. Eventually I’ve discovered that not all of my apps had migrations. So check if all of your installed apps (Django project wise) which have models.py files have migrations as well. That solved my issue (forcing Django to create migrations for specific app) and also checking that migrations.swappable_dependency(settings.AUTH_USER_MODEL), is listed and on the first position in migration dependencies.

0👍

This error occurs with the multiple databases I had setup with my previous version of django (1.5). The upgrade did not take to the multiple databases with south. Eventually I will have to re-visit this so that I can attempt migrations but in the meantime I have scrapped this. Removing the multiple database instances in my settings.py resolved the issue.

Leave a comment