You can use this class in your models.py class Category(CommanInfo): name = models.CharField(max_length=30) display_name = models.CharField(max_length=30) list_image = models.FileField(upload_to="uploads/images",null=True, blank=True) to use the image in html you must write this code in template.
in template you wil write categryItem.list_image.url in the img field. this will be a url , so you must define a images/\s+ url in the url.py 2008/12/25 Fluoborate <motoy...@gmail.com> > > I have a website that generates images (PNG's of graphs), and I want > those images to show up on the website, but I don't know how to do > this. > > Is this possible: > 1. Store the image file in an ImageField() in the SQLite 3 database. > How do I do this? > 2. Get the image from the database and easily serve it up in my HTML > template. How do I do this? > > I actually think that I might not want to store the images in the > SQLite database because there will be so many images. However, I do > want the images to be deleted if the SQLite objects corresponding to > them are deleted. How do I keep the collection of image files and the > database of what images it thinks it has in good agreement? Thanks. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---