0
votes

I am new to Django. I want to create tables by using models. I have tried to follow this link: https://docs.djangoproject.com/en/3.0/topics/db/models/.

I have registered the app and provided connection details of the DB.

But when I tried to run makemigrations and migrate, it's not identifying the changes. python manage.py makemigrations No changes detected

python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, sessions Running migrations: No migrations to apply.

any help would be appriciated.

1
have you specify the app name in settings.py in installed_app list - Kishan Parmar

1 Answers

0
votes

For a new app, one without any migrations, you must first create an initial migration file. This can be done by passing the app name to makemigrations

python manage.py makemigrations app

Here is the relevant section of the docs

To add migrations to an app that doesn’t have a migrations directory, run makemigrations with the app’s app_label