My environment is: Python3.6 django1.11.1 mysql
I use pymysql. When I learned it before, I used sqlite3. Now I use pymysql. Can I still create it by defining classes in models.py? Watch? Why do I write like this and then execute
python manage.py makemigrations
python manage.py migrate
The corresponding table is not generated in mysql?
You need to configure your model folder in INSTALLED_APPS of setting. For example, if you have a file called models.py and the upper-level folder is called app, then you need to configure the app into INSTALLED_APPS before it will be created
Add two lines of code to xxx/xxx/__init__.py: