[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.

πŸ‘€Pierre Monico

10πŸ‘

Try:

python manage.py makemigrations
python manage.py migrate
πŸ‘€Amiral Jion

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

πŸ‘€Sonam gupta

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.

πŸ‘€sptramp

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.

πŸ‘€Dhanush N

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