Re: Strange behaviour with ImageField

2009-03-25 Thread Julien Phalip
On Mar 26, 4:42 pm, Michael Strickland wrote: > You should just be able to take out the MEDIA_ROOT portion of your > upload_to path. So instead of: >     upload_to='%s/images/' % settings.MEDIA_ROOT > You would have: >     upload_to='images/' > > That should make it store the relative address and

Re: Strange behaviour with ImageField

2009-03-25 Thread Michael Strickland
You should just be able to take out the MEDIA_ROOT portion of your upload_to path. So instead of: upload_to='%s/images/' % settings.MEDIA_ROOT You would have: upload_to='images/' That should make it store the relative address and not the absolute address in your database. As for {{photo.

Strange behaviour with ImageField

2009-03-25 Thread Julien Phalip
Hi, Sorry if my question seems trivial, but I've looked around for an answer and I'm really at loss... I've got a simple model: class Photo(models.Model): image_file = models.ImageField(_('image file'), upload_to='%s/ images/' % settings.MEDIA_ROOT) But when I upload an image via the admin