Arquivo de Tags: satchmo

Problem:  When uploading images to Satchmo I got this error message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image." even with valid JPEG files.

To test the Python Image Library (PIL) I’d  executed this code on python console:

from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()

what output:

<PixelAccess object at 0x37dce100>

This is ok, but when I’d run the same code inside a Django view I got the error "decoding error when reading image file".

I checked the Python Path and it was the same for both console and Django Application.

After looking on google I discover a post from Peter Schoenster on “Django-Photologue“  wiki page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command

# lsof | grep libjpeg

I just remove the old libjpe62 from my system using:

# apt-get remove libjpeg62

And everything works !

Problem: Error on Uploading a image file to Satchmo. Message: "Upload a valid image. The file you uploaded was either not an image or a corrupted image."

To test the Python Image Library (PIL) I run this code on python console:

from PIL import Image
file = open("/tmp/logo.jpg")
image_test = Image.open(file)
image_test.load()

what output:

<PixelAccess object at 0x37dce100>

This is ok, but when I run the same code inside a Django view I got the error "decoding error when reading image file".

I checked the Python Path and it was the same for both console and Django Application.

After looking on google I discover a post from Peter Schoenster on “Django-Photologue”  home page saying he had the same problem and discovered that python shell was using one version of libjpeg and Apache was using other. (He, as me had two version of this library on the system). He discovered it using the command

# lsof | grep libjpeg

I just remove the old libjpe62 from my system using:

# apt-get remove libjpeg62

And everything works !

Satchmo is a great shopping cart application that uses Python and Django. If you are looking for this kind of application it worth a look.

One of the best point of Satchmo is how easy and beautiful is to customize your application. You can create customized product model without touch the base Satchmo models. It’s a great feature, that make easy to apply future Satchmo updates.

You can learn how to create a custom product in JuanjoAlvarez Blog.

I followed the instructions but get the error:

Wed, 12 Aug 2009 11:57:17 configuration DEBUG SettingNotSet: PRODUCT.PRODUCT_TYPES
Traceback (most recent call last):
File "./manage.py", line 27, in
execute_manager(settings)
.
.
.
.
raise SettingNotSet('%s config group does not exist' % group)
livesettings.models.SettingNotSet

SOLUTION: After apply a grep in the Satchmo code for “PRODUCT_TYPES” I figured out my mistake: My package was named product: the same name of the Satchmo product application. So it was overriding the framework application.

Thank god Satchmo is a Open Source project!