Silicon Valley takeaway interface writing

Continuing from the previous blog:
The second interface: Good guy, the data is not available directly. You have to go to the database to get it. I won’t worry about it here. Database access is not difficult (mysql is recommended. You can use phpmyadmin for the graphical interface of mysql. It is simpler and comes with python. SQLite can also be used), then we can write the data directly. If you are not worried, you can add a regular match to filter the Chinese characters. Don't let all ghosts and snakes get the data, so let's have a "fast food". Note that you need to add "" to the id, which is the dictionary writing method of Python.
Insert image description here

The third interface:
Insert image description here

This is a little more complicated and requires the use of url parameters. In fact, it is very simple, just write two more lines to get the url parameters, and the rest are exactly the same as interfaces 1 and 2.
Insert image description here

The 4th interface: This is not difficult if you have previous experience.
Insert image description here

The fifth interface: Just use ''' and ''' to return a string directly, because the verification code should be provided by the backend, and the security of the frontend is not good, so you don't have to worry about this if you have a general understanding.
The 6th interface: not difficult.
Insert image description here

The 7th interface: It is also very simple. Take a screenshot together with the 8th interface.
The 8th interface:
Insert image description here

The 9th interface, the 10th interface: The phone number here needs to match the user information from the database and then return it. However, this is not the focus of our front-end learning. We will do it later when we use it. Here we still return a hard-coded data.
Insert image description here
The github address of the code https://github.com/cmgfz/connector-by-flask-and-python
source code

Guess you like

Origin blog.csdn.net/returnadsss/article/details/128889105
Recommended