django getting the absolute path of a FileField

前端 未结 2 708
灰色年华
灰色年华 2021-02-19 07:09

I am trying to retrieve the absolute path (starting with http://) while calling a FileField at the template.

How can I achieve this ?

ie: {{fl.uploadedfile

2条回答
  •  时光说笑
    2021-02-19 07:59

    Just found the answer: adding .url fixes this issue fixes it such as {{fl.uploadedfile.url}}

提交回复
热议问题