I
I
Igor Tkachenko2017-02-21 14:54:03
Django
Igor Tkachenko, 2017-02-21 14:54:03

How to get url for uploaded image in django?

Sayzh.
I tried this: {{ profile.avatar.url }}, outputs:
home/***/projects/web_env/***/uploads/avatar/2017/02/21/1178208_u4zA9ru.jpg
how to solve this without crutches?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Kazantsev, 2017-03-18
@saintbyte

check MEDIA_ROOT and MEDIA_URL, there is a suspicion that they mixed it up. Without crutches, this is most likely some kind of templatetags thread of type static

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question