Question: 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?

Answer: 
To fix this problem here is what I did:

1) Find all foreign key relation fields like OneToOneField, ForeignKey and ManyToManyFields in your project, including any reusable apps that are referring to `auth.User` or import User and set it to settings.AUTH\_USER\_MODEL as above. At minimum use:

```
'auth.User'

```

2) For all the models that have the above, make sure the models have a valid django migration (not south). If they have south migrations, rename the directory to migrations\_south and then run the makemigrations command for that app:

```
./manage.py makemigrations affected_app

```

Sometimes there is a django migrations folder under a different name, not the default `migrations` directory. In such cases, reference this via `MIGRATION_MODULES` in your settings.py:

```
MIGRATION_MODULES = {'filer': 'filer.migrations_django'}

```

Since the issue was hard to find on larger projects, I commented out all custom apps in `INSTALLED_APPS` in settings.py and ran the test command, since it will run migrate and try to re-create the database for you:

```
./manage.py test

```

Looks like that fixed it for me. I'm not sure if step 1 is mandatory or just best practice. But you definitely need to convert the apps to migrations.

Cheers!

PS. Be ready for what's coming in [Django 1.9](https://docs.djangoproject.com/en/dev/releases/1.9/). The syncdb command will be removed. The legacy method of syncing apps without migrations is removed, and migrations are compulsory for all apps.
Maybe you have found the answer and resolved the problem, but I wanted to point out that, in my case, the above problem was solved by dropping the database and re-creating it again, with the full privileges of the users. I was able to do this because I'm working on a non-production environment, but doing this on a staging environment is not a good idea, so be careful.

Im using `python 2.7.12` and following are the specifications of my virtualenv:

```
Django==1.10.5
django-crispy-forms==1.6.1
django-registration-redux==1.4
djangorestframework==3.5.3
olefile==0.44
packaging==16.8
Pillow==4.0.0
psycopg2==2.6.2

```