20091015

Protocol Buffers in App Engine

I was disappointed the other day when I was playing with Google App Engine and tried to use a protocol buffer.  No dice.  After a bunch of digging, I've found a solution.  It isn't pretty but it works.
  1. Download and build the latest version of the protocol buffer source.
  2. Copy the python/google directory into the source directory of your App Engine project.
  3. Create an import_fixer.py in your App Engine project, and include the source referenced in this thread: http://groups.google.com/group/google-appengine/msg/12e6c7d9bcda7a46
  4. Follow the rest of the steps on that thread, i.e. after all of your google.appengine.* imports, include these two lines:
    import import_fixer
    import_fixer.FixImports('protobuf')
    
It's definitely disappointing that this is necessary: hopefully it won't be required in future versions of App Engine.

No comments:

Post a Comment