Python uses the Django library to collect data from web pages and insert it into the mysql database
1. Directory structure
Description: After the directory structure has been optimized, it has become the basic layout of model+html+views.
Baidu network disk link: https://pan.baidu.com/s/1uWRDyIZmDdGFkHskBEncEQ
Extraction code: ikuc
2. Implementation step
1. Create entity class
2. Execute the following three commands to create a database table
python manage.py makemigrations
python manage. py makemigrations web_t
python manage.py migrate
This command is executed sequentially after entering the root directory of the project in cmd, and the execution of cmd commands will not be introduced in detail.
When you see a string of ok, it’s all right, basically loading some library tables that Django depends on.
3. Views storage logic
4. Page implementation
5. Access settings
6. Access test