DEV Community

sium_hossain
sium_hossain

Posted on

 

#Solved - ValueError: The field admin.LogEntry.user was declared with a lazy reference.

Here is the error happened when we want to try Abstract User model in the middle of the project

Here is the Error look like πŸ‘

ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'core.user', but app 'core' doesn't provide model 'user'.
Enter fullscreen mode Exit fullscreen mode

We have to remove all migrations from our project by

find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
Enter fullscreen mode Exit fullscreen mode
find . -path "*/migrations/*.pyc"  -delete
Enter fullscreen mode Exit fullscreen mode

Then delete the database.Then run migrations & migrate again.

python manage.py makemigrations 
python manage.py migrate
Enter fullscreen mode Exit fullscreen mode

πŸ‘Š Voila problem Solved..

Top comments (3)

Collapse
 
mellen profile image
Matt Ellen

Super helpful, thank you!

Collapse
 
siumhossain profile image
sium_hossain

My pleasure πŸ’•

Collapse
 
andresfelipecs profile image
Felipe Castro

Thank you ! It solved the issues I had πŸ‘πŸΌπŸ™πŸ½

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git