[Fixed]-Django: python manage.py migrate does nothing at all

12👍

Well, you say that you first start the server and then type in the commands. That’s also what the terminal feed you shared shows.

Do not run the server if you want to run management commands using manage.py.

Hit Ctrl+C to exit the server and then run your migration commands, it will work.

10👍

Try:

python manage.py makemigrations
python manage.py migrate

3👍

I was getting the same error
running this 2 command in terminal

    python manage.py makemigrations
    python manage.py migrate

and then

    python manage.py runserver

solved my issues.
Thanks

2👍

@adam-karolczak n all

If there are multiple DJANGO Projects, it can happen that DJANGO_SETTINGS_MODULE is set to some other app in environment varibles, the current project manage.py will not point to current project settings thus the error.

So, confirm DJANGO_SETTINGS_MODULE in fact points to the settings.py of current project.

Close the project if its running viz. ctrl+C.
You can also check the server is not running ( linux ) by

ps -ef | grep runserver

Then kill the process ids if they exist.
If you confirmed settings.py in DJANGO_MODULE_SETTINGS is for the project you are having issue.
Run the following it should resolve.

python manage.py makemigrations
python manage.py migrate

Hope it helps.

👤Doogle

1👍

Have you tried with parameter?

python manage.py makemigrations <app_name>

0👍

I had the same issue and the problem was that there was a pg_dump script running at the same time I was trying to migrate. After the dump was completed, migrations ran successfully.

0👍

  • Check that INSTALL_APPS app exists, if not add it

  • Checks the model for default attributes

  • Running this 2 command in terminal

    python manage.py makemigrations
    python manage.py migration

0👍

  1. First exit of the present web server by typing Ctrl + C
  2. Then run python manage.py migrate

The Warning is due to not configuring the initial database or migrating.

0👍

for Collab try following command

!python manage.py makemigrations  #for creating new migrations based on the changes you have made to your models.
!python manage.py migrate
followed by
!python manage.py migrate runserver 

Leave a comment