1👍
✅
The quick fix here is to change media/{{ chord.file }}
to /media/{{ chord.file }}
. However, you shouldn’t be manually creating this path in the first place. I think you can do {{ chord.file.url }}
instead. Here I’m assuming that chord
is a model object with a FileField
named file
. I suggest you check the documentation for FileField
to verify this and understand it better.
Source:stackexchange.com