[Django]-Django makemigrations No changes detected in app

2👍

I just ran into an issue like this. In my case, the problem was that I had installed, through pip, the stable version of the package that I was developing, and Django was importing the stable version rather than my development version. To check if this is the case with you, try adding a syntax error to models.py. If makemigrations doesn’t trigger the syntax error, then you’ll know that your version is not even being loaded by the python interpreter.

1👍

If your model is not inheriting from django model then, you will see aforementioned error. Make sure that your custom model inherits from django models.Model, something like this.

from django.db import models

class Posts(models.Model):
    ...

-3👍

Deleting the DB and creating new one will never work since it refer the previous migration files. Delete all previous migration files and pycache files except init. Then try running these.

    python manage.py migrate --fake-initial
    python manage.py makemigrations
    python manage.py migrate

This worked for me

👤SUP

Leave a comment