3

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?

Vladimir Mihailenco
  • 3,382
  • 2
  • 24
  • 38

1 Answers1

0

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
  • 854,459
  • 170
  • 1,222
  • 1,395
  • 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 Mihailenco Aug 20 '10 at 15:52
  • 5
    Alex the answer above doesn't actually show where in the SDK the restrictions are actually implemented. Have you done this successfully? How? Thanks. – mikemaccana Mar 10 '11 at 16:30