Skip to content
Advertisement

Django: Related model ‘users.UserProfile’ cannot be resolved

I tried running makemigrations and after migrate and I am constantly getting this error:

JavaScript

What I was trying to do is Link a UserProfile model to Django’s own User Model:

JavaScript

The “Contests” model (as you can see in my installed apps below) uses the User Model as well without any errors.

My Installed apps look like this :

JavaScript

My migration file 0001_initial.py is the following:

JavaScript

Other notes:

  1. I use multiple settings files but my installed apps are all in my base setting file so this should not be the issue.

  2. I am using Python Social Auth to create a Pipeline and create the UserProfile. (But this should not have any effect on the creation of the model in the database)

  3. I even dropped the database and recreated it but I still get the same error.

Thanks in advance!!! :)

Advertisement

Answer

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

Everything Works now.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement