When adding an image upload function,
If you use the ImageField that comes with Django,
It's convenient because it processes whether the image is appropriate,
It doesn't work because App Engine doesn't have PIL.
Actually using ImageField
no module named image
An error like this will occur and both development and production will fail.
I've always been skeptical about how to install PIL.
Django's framework can't be tampered with with genuine App Engine, so I thought I had to write the process myself, I googled and found a solution.
The PIL features that Django uses The solution is to create a dummy wrapped in the App Engine API. Now you can use ImageField without messing with Django's core.
PIL/init.py The source is above. Create a folder called PIL in the root of your App Engine application and Create the above init.py there and you're ready to go. After that, you can use ImageField like normal Django.
Recommended Posts