Modify the request. Post.get () is request. Post.getlist () results as in the blue horizontal bar below, fully meet the requirements of the project
The background database has only one field stored for the picture, and it is not possible to have as many fields as the number of photos. Other words
1: One can only be stored in the background to the database at a time.
2: In front of the show, you can directly cycle this field to show my picture
So this involves a list (a dictionary) with the data that is stored in the loop.
The dictionary is used because each of my pictures also has its own picture description, both of which are submitted and saved at the same time.
Make a list of the URL that you saved with the picture, and then save it in a loop.
The main use of this is the Python zip () function
>>> s=[' A ', ' B ']
>>> b=[' 1 ', ' 2 ']
>>> Zip (s,b)
[(' A ', ' 1 '), (' B ', ' 2 ')]
Python Django bulk upload file and bind the description of the corresponding file