close

[Solved] Django – makemigrations – No changes detected

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Django – makemigrations – No changes detected in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Django – makemigrations – No changes detected Error Occurs?

Today I get the following error Django – makemigrations – No changes detected in python.

How To Solve Django – makemigrations – No changes detected Error ?

  1. How To Solve Django – makemigrations – No changes detected Error ?

    To Solve Django – makemigrations – No changes detected Error To create initial migrations for an app, run makemigrations and specify the app name. The migrations folder will be created.

  2. Django – makemigrations – No changes detected

    To Solve Django – makemigrations – No changes detected Error To create initial migrations for an app, run makemigrations and specify the app name. The migrations folder will be created.

Solution 1

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

Solution 2

I’ve read many answers to this question often stating to simply run makemigrations in some other ways. But to me, the problem was in the Meta subclass of models.

I have an app config that says label = <app name> (in the apps.py file, beside models.pyviews.py etc). If by any chance your meta class doesn’t have the same label as the app label (for instance because you are splitting one too big app into multiple ones), no changes are detected (and no helpful error message whatsoever). So in my model class I have now:

class ModelClassName(models.Model):

    class Meta:
        app_label = '<app name>' # <-- this label was wrong before.

    field_name = models.FloatField()
    ...

Running Django 1.10 here.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read