After creating a new model, even if you execute make migrations, the output will be as follows, and I encountered a phenomenon that the migration file is not created, so make a note of the countermeasure.
#Execute the following command after creating a new model
$ python manage.py makemigrations
No changes detected
app
├─migrations
├─models
│ ├─__init__.py
│ ├─accounts.py
│ └─users.py #Newly added model this time
└─views
├─__init__.py
└─account.py
Apparently, if the model is created by dividing it into the models folder, it will not be recognized unless the newly created model is imported into \ __ init__.py.
app/models/__init__.py
from accounts.py import AccountsModel
Add the newly added users.py here.
app/models/__init__.py
from accounts.py import AccountsModel
from users.py import UsersModel #Newly added
$ python manage.py makemigrations
Migrations for 'app':
app\migrations\0002_users.py
- Create model UsersModel
I was able to create it safely!