views:

664

answers:

1

Hello

On sunday, I had problems with python modules, when I installed stackless python. Now I have compiled and installed :

setuptools & python-mysqldb and i got my django project up and running again. (i also reinstalled django-1.1),

Then I compiled and installed, jpeg, freetype2 and PIL. I also started using mod_wsgi instead of mod_python.

But when uploading imagefield in form I get validationerror:

Upload a valid image. The file you uploaded was either not an image or a corrupted image.

Searchmonkey shows that it comes from field.py imagefield validation. before raising this error it imports Image from PIL, opens file and verfies it. I tried importing PIL from python prompt manually - it worked just fine. Same with Image.open and Image.verify. So what could be causing this problem?

Alan

A: 

Might want to check out this blog post and see if it addresses your problem.

http://www.chipx86.com/blog/2008/07/25/django-tips-pil-imagefield-and-unit-tests/

Joshua
i checked it out, but it seems to have little to do with my case. In my case the script fails at import image fro PIL. Like i said i could import PIL and image from PIL just fine, but django could not find it. In any case it would be quite annoying for me to duplicate the situation now, because i have reinstalled the whole system. I guess the probelm could have been solved by putting the location of newly compiled PIL to django.wsgi script or something. At that point i did not think of it though...
Zayatzz