2013年2月13日

在 virtualenv 環境使用Google App Engine

在Mac上使用python virtualenv建立GAE project
1.建立workspace
mkdir app 2.建立virtualenv
cd app virtualenv --python=python2.7 --no-site-packages venv 3.帶入GAE環境
vi venv/lib/python2.7/site-packages/gae.pth 以Mac環境為例 /usr/local/google_appengine/lib/ /usr/local/google_appengine/lib/antlr3 /usr/local/google_appengine/lib/argparse /usr/local/google_appengine/lib/cacerts /usr/local/google_appengine/lib/cherrypy /usr/local/google_appengine/lib/concurrent /usr/local/google_appengine/lib/django-1.5 /usr/local/google_appengine/lib/enum /usr/local/google_appengine/lib/fancy_urllib /usr/local/google_appengine/lib/google-api-python-client /usr/local/google_appengine/lib/graphy /usr/local/google_appengine/lib/grizzled /usr/local/google_appengine/lib/httplib2 /usr/local/google_appengine/lib/ipaddr /usr/local/google_appengine/lib/jinja2-2.6 /usr/local/google_appengine/lib/markupsafe-0.15 /usr/local/google_appengine/lib/mox /usr/local/google_appengine/lib/oauth2 /usr/local/google_appengine/lib/prettytable /usr/local/google_appengine/lib/protorpc /usr/local/google_appengine/lib/PyAMF-0.6.1 /usr/local/google_appengine/lib/python-gflags /usr/local/google_appengine/lib/setuptools-0.6c11 /usr/local/google_appengine/lib/simplejson /usr/local/google_appengine/lib/sqlcmd /usr/local/google_appengine/lib/webapp2-2.5.2 /usr/local/google_appengine/lib/webob-1.2.3 /usr/local/google_appengine/lib/yaml-3.10 可以使用以下指令稍作修正 find /usr/local/google_appengine/lib/ -type d -maxdepth 1 4.安裝需要的模組