views:

45

answers:

1

I want to use IPython under GAE to debug scripts locally:

import ipdb; ipdb.set_trace()

but GAE restricts loading some modules from sys.path. Can I bypass this somehow?

+1  A: 

You can hack the GAE SDK's restrictions of course (you do have its sources on your computer, and it's open-source code!-), but, if you do, it won't catch the cases in which your code erroneously tries to import modules it won't be allowed to use on Google's servers. So I suggest, at the very least, if you do perform such a hack, make it conditional on some environment variable (if os.getenv('MYHACK')=='Y': ...), so that it's disabled by default (and the GAE SDK behaves normally) and you only enable it explicitly at your shell with e.g.

$ MYHACK=Y ipython ...

at a bash (or sh;-) prompt.

Alex Martelli
Thanks for answer. May be I will try do it myself, but to be honest I am not very familiar with Python and GAE internals and there is a lot of code to explore. For now I am able just to check sys.path :)
Vladimir