pythondjangodjango-migrations

Django - makemigrations - No changes detected


I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected".

Usually I create new apps using the startapp command but did not use it for this app when I created it.

After debugging, I found that it is not creating a migration because the migrations package/folder is missing from an app.

Would it be better if it creates the folder if it is not there or am I missing something?


Solution

  • To create initial migrations for an app, run makemigrations and specify the app name. The migrations folder will be created.

    ./manage.py makemigrations <myapp>
    

    Your app must be included in INSTALLED_APPS first (inside settings.py).