Skip to content

Instantly share code, notes, and snippets.

@janjongboom
Created August 8, 2012 15:12
Show Gist options
  • Save janjongboom/3295779 to your computer and use it in GitHub Desktop.
Save janjongboom/3295779 to your computer and use it in GitHub Desktop.
Python web service on Cloud9 IDE
Hi,
First you'll need to get appengine into your project, you can do this from CLI or terminal:
wget http://googleappengine.googlecode.com/files/google_appengine_1.7.0.zip
unzip goo
rm google_appengine_1.7.0.zip
Or by dragging the unzipped appengine tools into Cloud9, if you're not premium.
Then create hello.py
print 'Content-Type: text/plain'
print ''
print 'Hello, world!'
And create app.yml
application: helloworld
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: helloworld.py
Now execute (in console):
python ./google_appengine/dev_appserver.py . -a $OPENSHIFT_INTERNAL_IP -p $PORT --skip_sdk_update_check
The server starts, but when you access: projectname.uname.c9.io it shows a stack trace. I don't really know that much about GAE, so maybe you can help me out here. I understand that it cannot access a package it likes (setuptools), which is correct because that folder isnt accesible. Do you know of any way to override the library path of Python? So I install it in the local directory with:
easy_install setuptools
(I now have a file in ~/lib/python/site-packages)
But Python seems to ignore me on this one. :-( Any idea?
Jan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment