A
A
AlexBoss2018-10-18 09:43:31
Django
AlexBoss, 2018-10-18 09:43:31

How does django ImageField.url work?

After writing in the ImageField field, the image was saved in the project root in the media folder. When accessing a database like test.image.url, it gives the path /media/image.jpg, but I can access the image itself only through the link mysite.ru/myapp/media/image.jpg, there is no media folder in myapp at all. How to solve this issue, inserting the name of the application everywhere is such an idea.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2018-10-18
@BuriK666

https://docs.djangoproject.com/en/2.1/ref/settings...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question