Hello!
I am rather new to Python and to Django. I installed Django "with no
magic" and Dojo integration on top of it. Then I tried Image handling
and I get some errors or unexpected features :)
As I experienced, Django imports Image handling classes from PIL, for example
>>> from PIL import Image
and some PIL tests made by PIL developers import Image hanfling
classes directly, for example
>>> import Image
So I set PYTHONPATH to both locations: the root of PIL and the PIL itself.
FYI, my development platform is Mac OS X 10.4.6, Python 2.3,
Magic-removal Django.
Now the problems:
__1__. Image upload (and File upload as well) is always a required
attribute (even if I set core to False).
__2__. When I upload an Image, I get this kind of error:
Exception Type: TypeError
Exception Value: attribute name must be string
Exception Location: django/db/models/base.py in _save_FIELD_file, line 332
this is the line that adds the Image upload field in my model:
illustration = models.ImageField(upload_to="images%Y%m",
width_field=100, core=False, help_text="OK");
MEDIA_ROOT and MEDIA_URL are set and works perfectly as I tested that
with file upload.
I tried to open an Image manually using python IDE:
>>> from PIL import Image
>>> from cStringIO import StringIO
>>> Image.open(StringIO("/some/existing/path/to/image.jpg"))
Then I get
File "<stdin>", line 1, in ?
File "PIL/Image.py", line 1745, in open
IOError: cannot identify image file
I also tried to create a new image using Python per IDE and it works
OK, so perhaps this is not a problem of PIL installation?
So do you have any ideas concerning the two problems of mine? If these
are the problems that should be asked in django_users group, then I
will resend this message there. Thank you for your attention.
Sincerely,
Aidas Bendoraitis aka Archatas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers
-~----------~----~----~----~------~----~------~--~---