Django-Photologue : Error 500 while uploading jpg files but uploading png files works

352 Views Asked by At

When I try to add jpg files in django-photologue I get "Server Error (500)".

The apache logs show :

"POST /admin/photologue/photo/add/ HTTP/1.1" 500 330 http://www.mywebsite.net/admin/photologue/photo/add/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"

The file is actually uploaded to the media folder on the server but it doesn't show in the admin interface and I cannot add it to a gallery.

Also adding png files works just fine.

Any suggestions please?

EDIT: When I enable django's debug I get

Exception Type: UnsupportedOperation Exception Value: fileno Exception Location: /usr/local/lib/python2.7/dist-packages/photologue/models.py in create_size, line 455 –

2

There are 2 best solutions below

1
On BEST ANSWER

The issue was due to the version of Django I was using (1.6). I updated to the latest Django release and it fixed the problem.

0
On

As karthikr has already said: it's very hard to offer advice if you supply no error messages/only part of the error message.

However, you state that JPG files cause an error, while PNGs work well. This would suggest to me an issue with Pillow on your platform; Pillow is a dependency for Photologue, and can be very troublesome to install (and get working correctly). Try googling 'Pillow jpg', together with the name of your operating system.