Django: You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s)
Hello, I was learning Django basics and then I found this error while starting the server in Django.
The error was: You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
In this tutorial, I will show you how to fix this error easily using the terminal.
Before jumping to the solution we should understand what does this error means.
If you look at this part of the error: apply the migrations for app(s): admin, auth, contenttypes, sessions.
you can get an idea that this error has something to do with these terms.
Basically, your project is created but the tables in the database are not ready yet.
How to fix this error:
When you get this error, you have to quit the server first by pressing Ctrl + C
. (Press Ctrl and hold it and press c while holding down the Ctrl key)
Then run this command:
python3 manage.py migrate
If you are using python3 then you can use the above command otherwise you can run python manage.py migrate
.
After running that, you will see something like this:
Leave a Reply