Skip to content

Instantly share code, notes, and snippets.

@sgammon
Created March 26, 2012 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgammon/2210470 to your computer and use it in GitHub Desktop.
Save sgammon/2210470 to your computer and use it in GitHub Desktop.
the magic fix for the dev server's bullshit
import sys
if 'lib' not in sys.path:
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/dist.zip, loaded using zipimport.
sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip']
class AppBootstrapper(object):
@classmethod
def prepareImports(cls):
if 'lib' not in sys.path:
sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip']
from webapp2 import RequestHandler
from webapp2 import WSGIApplication
from google.appengine.ext import webapp
webapp.RequestHandler = RequestHandler
webapp.WSGIApplication = WSGIApplication
return cls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment