Hey Surajeet

At first, you will need to create a model with the Field `ImageField`(do 
not forget to install pillow using `pip install pillow`) in the models.py 
of your app.
Then, you will need to register that model to admin.py of the app and then 
start the webserver. So, you will be able to see the model in your admin 
panel and thus upload the image there.
To show an image in the HTML page, you will need to create a view function 
and pass a context with {item: <image fetched from models>} and then write 
in your template code `<img src="{{item.image.url}}" />`

Regards
Akash Purandare

On Friday, February 15, 2019 at 12:07:04 AM UTC+5:30, Surajeet Das wrote:
>
> How do I upload images from admin panel and retrieve from a html page ?
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/80b77d97-7eb4-46f2-bf58-28a120b9d60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to