Please follow these steps:
Display Image in a Django Template (using ImageField)
* Add this to your settings file: ...
* Create a folder named "media" under your project root directory,
meaning the folder will be on the same level as your apps.
* Add these to your main urls.py. ...
* In your model, use ImageField for the field being used for the image. ...
* Add below to your template to load your images.
Yours
JJM
2020-03-21 14:51 GMT-04:00, Sandip Nath <techsandip@gmail.com>:
> I am developing a car rental app. I have esigned it such a way that the car
>
> and driver images will be uploaded from admin page during runtime from
> media folder. The models.py working fine. Images can be uploaded to the
> media folder. But the images are not getting diplayed on the car page.
> Should the img source in car template be changed to the path of the media
> folder?
> Please advice.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/deafdbcf-5b91-436d-a8aa-68d58ab80df3%40googlegroups.com.
>
--
*M.Sc. Juan J. Moreno*
En Venezuela (Maracaibo)
Skype:studiom2j
Tel (Italy): +39 02320628565
NB: Telf. mobil (en reparacion)
<https://www.bitrix24.net/id14591859/>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMf5Kvyfu3y%2BF0VSZMsEimNUGgFufvODS%2BecLkuR083bLjXrjg%40mail.gmail.com.
No comments:
Post a Comment