models.py
class Post(models.Model):
image = models.FileField(upload_to='note/static/note/')`
template
<img src={{note.image.url}}
error:
[14/May/2021 08:42:07] "GET / HTTP/1.1" 200 402
Not Found: /note/static/note/test.png
[14/May/2021 08:42:07] "GET /note/static/note/test.png HTTP/1.1" 404 2357
Did I do anything wrong?
You will have to use the
static
template tag. Something like thisMore to this can be found here https://docs.djangoproject.com/en/3.2/howto/static-files/