Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

auth_user error with Django 1.8 and syncdb / migrate

When upgrading to Django 1.8 (with zc.buildout) and running syncdb or migrate, I get this message:

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

One of my models contains django.contrib.auth.models.User:

user = models.ForeignKey(     User, related_name='%(app_label)s_%(class)s_user',     blank=True, null=True, editable=False ) 

Downgrading to Django 1.7 removes the error. Do I have to include the User object differently in Django 1.8?

like image 550
mpso Avatar asked Apr 17 '15 02:04

mpso


People also ask

Does Django handle migrations?

Django can't automatically generate data migrations for you, as it does with schema migrations, but it's not very hard to write them. Migration files in Django are made up of Operations, and the main operation you use for data migrations is RunPython .


1 Answers

I fix this by running auth first, then the rest of my migrations:

python manage.py migrate auth python manage.py migrate 
like image 180
Dave Lawrence Avatar answered Oct 13 '22 05:10

Dave Lawrence