Hi all,

I'm a Django newbie having some trouble getting image uploads to work.
I've read the docs pretty carefully, I have PIL installed, and I've
been googling without success for a while now. Hopefully, my dumb
mistake will jump out at someone reading this...

Anyway, here is my trivial model:

class Thing(models.Model):
  image = models.ImageField(upload_to='images')

In settings.py, I have:

MEDIA_ROOT = '/Users/michael/code/things/static/'

The /Users/michael/code/things/static/ directory exists, and it
contains an "images" subdirectory.

I'm just using the built-in development server, so file permissions
shouldn't be a problem. (This is on a Mac, by the way.)

When I try to upload an image (PNG or JPG) through the admin app, I
get the error: "Upload a valid image. The file you uploaded was either
not an image or a corrupted image."

I fired up Python and was able to use PIL to open the files that I
tried to upload, without a problem, so I don't think it's a PIL
problem.

Before I start digging through the Django code that validates
ImageFields, I thought I'd see if anyone could point me in the right
direction to debug this.

Thanks in advance,
Michael

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to