Monday, August 11, 2008

Working with Django 1.0 and Google App Engine

logo160.pngI've taken some time off regular work to build BaristaReview.com, a site where you can find and review your local coffee shops.

To build this new site, I decided to use Google App Engine and Django.

Right now, Django is racing towards the version 1.0 release and it's changing fast. Unfortunately, due to some constraints in the runtime and the fact that you have to use Google's Database, it's not all smooth sailing.

Most things are working quite well, and the site is very responsive (certainly to django hosting I've tried elsewhere), but I've run into some roadblocks when I come to upload image files.

On App Engine you can only run pure python code, so using the latest Django I see log entries like this:

Could not import "fcntl": Disallowed C-extension or built-in module


More seriously, there is no local file system, so when I try to upload an image file, it fails with:

NotImplementedError: This class/method is not available.


When django tries to get a temporary file like this:

self._file = tempfile.NamedTemporaryFile(suffix='.upload')


Which is fair enough.

Anyhow, it's early days and there's lots of other people playing with this technology. Certainly it's a great deal from Google and I'm totally excited about the state of Django. I'm in geek heaven.

No comments: