I want to use 开发者_Python百科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?
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.
精彩评论