make makemigrations work again
making makemigrations work in Django when migrations is not pushed to git

Search for a command to run...
making makemigrations work in Django when migrations is not pushed to git

No comments yet. Be the first to comment.
Clean your email list even before sending it to a mass emailing solution like AutoSend to avoid a high bounce rate

Try using an alternative to openclaw, which they claim is cheaper to use

Using types (and interfaces) to define a blueprint of a variable

Using GraphQL as an alternative to REST API for Hashnode

In Django, the recommended standard is to push the migrations folder of (an app) also to git.
Initially I never used to push migration files to GitHub and I ended up having to do python make migrations as well as python manage.py migrate on the server - whether it was manually or via a pipeline.
There was one common pitfall to this which I stumbled on many times only to figure it out later - this post is to remind me of how to come out of that pit.
python mange.py makemigrations would always say “No changes detected” even when you had a model in a brand new app.
Note: This is only relevant to new Django ‘apps’ created (or pulled from Git) - if you had already done makemigrations and migrate on an app previously and it worked then running the same for the second time would work. The reason why it doesn’t work for the first time is because Django looks for a migrations folder and the __init__.py file in the migrations folder for makemigrations to work.
Goto to the app, say it be booking and create a migrations folder and create an empty __init__.py file in it. Now run python mange.py makemigrations, it should work as expected.
cd booking
mkdir migrations
cd migrations
touch __init__.py
cd ../..
python manage.py makemigrations
python manage.py migrate