Hi

18 views
Skip to first unread message

Umar Kambala

unread,
Sep 3, 2018, 12:12:19 PM9/3/18
to django...@googlegroups.com

Plz how do I add pictures to my poll questions? I have successfully completed the tutorials and I now wants to modified my site to have images so that people can vote.

Mikhailo Keda

unread,
Sep 3, 2018, 1:11:17 PM9/3/18
to Django users

Mohammad Aqib

unread,
Sep 3, 2018, 1:14:57 PM9/3/18
to django...@googlegroups.com
Add below line into your model.

image = models.ImageField(upload_to='pathwheretoupload')

On Mon, 3 Sep 2018, 10:41 pm Mikhailo Keda, <mri...@gmail.com> wrote:
--
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...@googlegroups.com.
To post to this group, send email to django...@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/91b5e833-2f6e-4eba-918e-ddbf6f7610e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Devender Kumar

unread,
Sep 4, 2018, 3:24:28 AM9/4/18
to django...@googlegroups.com
There are few things to keep in mind while playing with images
1. media url in setting file
2. upload_to field in model
3 enctype="multipart/form-data" in form tag.

Enjoy 
Dev

Reply all
Reply to author
Forward
0 new messages