Models. Py ImageField column of table
Direct registration was just a text shown in the admin path
How to show the path for a picture?
Many, baidu for two days, the answer are tested, not one of
Ask your bosses, all give you...
# models. Py
# product table, basic table
The class Product (models. Model) :
.
Watch_pic=models. ImageField (upload_to='media/watch_base_img, default=' media/watch_base_img/lazda. JPG ')
# admin. Py
Admin. Site. Register (Product)
CodePudding user response:
You first try to find a successful way to others
https://blog.csdn.net/le_17_4_6/article/details/81810627
Then ask you encounter error
CodePudding user response: