A blog about one guys quest to learn Python, Django and Google App Engine.
Feed: http://appengineguy.com/atom.xml

måndag 18 augusti 2008

Serving static files with Django and AWS - going fast on a budget

Found this little gem linked from TechCrunch today.

Serving static files with Django and AWS - going fast on a budget

Speed matters. When Google tried adding 20 additional results to their search pages, traffic dropped by 20%. The reason? Page generation took an extra .5 seconds. This article will show how Eventseer utilizes an often overlooked way of improving the responsiveness of a web application: Pre-generating and serving static files instead of dynamic pages.

måndag 11 augusti 2008

New Django Helper

I've been way too hard at work on SlurpBOX to notice, but the fine App Engine Helper for Django guys have made a new release! See the top item in the release notes? I found that bug! :P Go download.

Release notes
Wed 6 August 2008
=================

This is the last version of the Google App Engine Helper for Django that will support Django 0.96. Future development of the helper will be targetted for the upcoming 1.0 release of Django.

  • Improved SDK detection on Windows by looking at both the PATH variable that may be set by the installer and using the win32api module (if available) to look for the SDK in the default Program Files location.
  • Replaced the startapp command with a version that installs an App Engine Compatible application skeleton. Patch contributed by Andi Albrecht.
  • Changed the default runserver port to 8000 to match standard Django behaviour. Path contributed by Waldemar Kornewald
  • Email server settings from the Django settings file are provided to the App Engine Mail API. Patch contributed by Waldemar Kornewald
  • Added support for the Django memcache cache backend. Patch contributed by Jonca Rafal.
  • Added support for the Django session middle with db and cache backends for Django 1.0alpha only. Patches contributed by Jonca Rafal and Waldemar Kornewald
  • Moved the Django compatible login_required decorator to the standard Django location. Patch contributed by Andi Albrecht
  • Replaced the Django ModelForm class with the App Engine ModelForm class
  • Added a repr implementation for the BaseModel class
  • Many minor improvements to increase robustness and avoid errors if portions of Django are not present.

fredag 8 augusti 2008

My first Real App Engine App





Hey folks! Check out my first real App Engine application, SlurpBOX! Please check it out, and offer suggestions on how to improve it!

fredag 1 augusti 2008

Encoding/unicode reminders to myself and others

Encoding is, along with Regular Expressions, one of those subjects I never seem to properly learn. Here are a few pointers to my future self whenever I run into a pesky UnicodeEncodeError.
  1. Read this article for the umtillionth time. This might be the time it "clicks" for you.
  2. Don't get fancy with ISO-8859-1. Just use UTF-8. App Engine hates everything that is UTF-8.
  3. Make sure your text editor saves the files using UTF-8 encoding.
  4. Make sure that the
  5. Put # coding=UTF-8 at the top of every .py file
  6. Put a u in front of every string that contains non-ascii chars. Like this u"Jag är en liten hatt och är bög"
  7. When handling incoming requests, make sure you set the encoding correctly using request.encoding = "UTF-8" in your view
  8. Use ugettext as your alias for _
  9. If a method (such as quote() or hashlib.sha224() requires bytestrings as input, encode your unicode strings first - like this: theunicodestring.encode("utf-8")