Reputation: 7197
is there an easy way to execute scripts on Google App Engine localhost? For instance i have few scripts to generate pilot data, it's quite painful to copy-and-paste them to the interactive console all the time.
Currently, i'm using a simple bash script to do this, but i'm not sure this is the best solution.
curl --data-urlencode "code=`cat src/gen_pilot_data.py`" http://localhost:8079/_ah/admin/interactive/execute
thanks, V
Upvotes: 1
Views: 1061
Reputation: 101149
Check out remote_api_shell.py, included in the SDK. This lets you run code on your local machine against APIs on your App Engine app, be they in production or on the dev_appserver.
The other option you have is to make your scripts into handlers, and simply GET or POST to the relevant URLs.
Upvotes: 3
Reputation: 3382
There is nothing special to do in order to execute script on AppEngine, but if you want to use AppEngine APIs you have to boot AppEngine before. I don't know the builtin one-line way, but you can take look how various projects do this:
https://bitbucket.org/wkornewald/djangoappengine/src/4f5d7a223084/boot.py
http://code.google.com/p/nose-gae/source/browse/trunk/nosegae.py?r=54
You can also try to import your script in console:
import gen_pilot_data
Upvotes: 0