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?
1 answer
Find more questions by tags DjangoPython
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
in urls.py
djbook.ru/rel1.7/ref/settings.html#media-url
In the template write:
djbook.ru/rel1.7/howto/static-files/#configuring-s... - meda_Thiel commented on September 19th 19 at 12:36