I currently serve up images via the DB vs. filesystem.  I did this in
order to keep the data in one place, but I now regret it.

I'd recommend overriding the delete() of your image class to take care
of deleting the related image from your storage.

Depending on your needs and the amount of data, you may also want to
have a separate process that iterates through your filesystem images
and makes sure they are in the DB.  a cheap way to do this is md5 your
files and use that as an indexed key in your table.

Cheers,

-d

On Dec 25, 12:18 am, Fluoborate <motoy...@gmail.com> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to