My first day with Google App Engine

I got a chance to mess with Google App Engine today.

Google App Engine, as a web hosting platform, is quite different from what a typical PHP developer, such as me, usually comes across.

I was looking to develop a simple Django app onto the GAE platform.
Here are the main things I learned today.

First of all, the version of Django that comes with the python SDK is 0.96, by far not the youngest of ones… so there’s a bit of setting up to do to before you can get to work.
Note that the total file limit for the hosting is 1000 and the typical django installation exceeds that, so you have to include django with zipimport.
The best article I found describing the process is here: http://aralbalkan.com/1757

Other things to note:

  • Don’t expect to be able to ftp to the server and upload your stuff. The GAE has a much more complex network for storing data so you can only “upload” your application through the SDK’s update command.
  • Similarly there’s no way to retrieve your uploaded data from the server. I guess it’d be possible to write a script that would read the files on the server and send them to you.
  • For the same reason, you can’t create files in your scripts. Doing open(‘file’, ‘w’) will get you an error. You can open files in mode ‘r’ though.
  • …and for the same reason, you can’t simply store user-uploaded files – you need to put them in the database instead.
  • GAE has it’s on database engine and it’s own SQL language. It’s similar but it’ll surely take some messing around with. Because of this, GAE doesn’t support Django’s native models … -_-. There’s a “helper” project to ease the transition from Django’s models to GAE’s here: http://code.google.com/p/google-app-engine-django/ (it’s also included in the article above)
  • A bunch of other stuff, like sockets are disabled.
  • 30 seconds is the maximum execution time for any scripts. You can have cron jobs though, so that’s good

… and a bunch of other stuff I’m not remembering right now

  1. No comments yet.

  1. No trackbacks yet.