How to get URL of the image uploaded in the field FileField in Django model?

The problem is this:
You have a page with a display of objects using the generic views. Each object is displayed in a separate DIV.
Need that this DIV the background image was a picture uploaded to a FileField object.
How to implement it?
September 19th 19 at 12:28
1 answer
September 19th 19 at 12:30
I have already read, but has not made clear.
I was able to configure the uploading of files to the media directory in the root of the Django project, but I did not get to address with .url, i.e. the address is returned, but the browser cannot open this file.
How to configure MEDIA_URL? - Odessa84 commented on September 19th 19 at 12:33
MEDIA_URL = '/media/'

mapping includes += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
In the template write: - meda_Thiel commented on September 19th 19 at 12:36

Find more questions by tags DjangoPython