no changes detected appears
python manage.py makemigrations
No changes detected
Why
When executing this command, he will go to all models and generate tables in the database
because sometimes when there are many app projects, he doesn’t know which model to look for and which model to generate the database table in
Here are models.Py
You need to add the name of the app project to the Django setting configuration file, such as CMDB
Then Django will go to the CMDB project to find models. Py to generate the database
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'cmdb',
]
python manage.py makemigrations
Migrations for 'cmdb':
cmdb\migrations\0001_initial.py
- Create model UserInfo
The generation of this representative succeeded
Similar Posts:
- [Solved] Django Error: – no such table: main.auth_user__old
- [Solved] django.db.utils.ProgrammingError: (1146, u”Table” xxx doesn’t exist”)
- [Solved] You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for…
- ImportError: No module named pytz
- [Solved] Djiango Create Migrations Error: query = query.decode(errors=’replace’) AttributeError: ‘str’ object has no attribute ‘decode’
- [Solved] Django database Modify Warning: Did you rename house.houseid to house.id (a BigAutoField)? [y/N] n
- [Solved] Django cannot create an app after creating a project
- Django auth.User.groups: (fields.E304) Reverse accessor for User.groups clashes with reverse
- Django exception-ImportError: No module named django.core.management
- How to Solve Django Error: No such column: xxx