[Django]-Django: Related model 'users.UserProfile' cannot be resolved

17👍

I have deleted all migration files from other apps and run makemigrations and migrate again.

Everything Works now.

👤Tony

6👍

Try running migrations one by one for every model.

This way you can debug the app you are facing problem with

python manage.py migrate appmname

Maybe running migrations one by one may help

3👍

I experienced a similar issue where i created a custom user model (as written in the documentation before the first migrate).

class User(AbstractUser):
    pass

AUTH_USER_MODEL = 'account.user'

When trying to migrate i ran into “ValueError: Related model ‘account.user’ cannot be resolved”.

It got resolved after i first generated the migration for the new custom user model.

Paul

Leave a comment