Display an image located in the database in Django

前端 未结 3 599
失恋的感觉
失恋的感觉 2021-02-09 09:56

I just want to display an image that i have uploaded through the admin module, through an html image tag on a web page. The image is located in /home/user/work/djcode/media/chic

3条回答
  •  名媛妹妹
    2021-02-09 10:30

    You need to use {{MEDIA_URL}} or {{STATIC_URL}} , the choice depends on how you manage your files on server.

提交回复
热议问题