pudb を使用して、Google アプリ エンジンで Python アプリケーションをデバッグしたいと考えています。virtualenv を使用せずに buildout をインストールし、そのための構成ファイル buildout.cfg を作成しました。
[buildout]
develop = .
parts =
python
app
pudb
nosetests
zipsymlink
eggs =
gaeapp
unzip = true
[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}
[app]
recipe = rod.recipe.appengine
url = https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.11.zip
server-script = dev_appserver
src = ${buildout:directory}/src/gaeapp
exclude = tests
zip-packages = True
[pudb]
recipe = zc.recipe.egg
eggs =
gaeapp
pudb
[nosetests]
recipe = zc.recipe.egg
eggs =
NoseGAE
WebTest
gaeapp
nose
extra-paths =
${buildout:directory}/etc
${buildout:directory}/parts/google_appengine
${buildout:directory}/parts/google_appengine/lib/antlr3
${buildout:directory}/parts/google_appengine/lib/fancy_urllib
${buildout:directory}/parts/google_appengine/lib/ipaddr
${buildout:directory}/parts/google_appengine/lib/webob_1_1_1
${buildout:directory}/parts/google_appengine/lib/webapp2/
${buildout:directory}/parts/google_appengine/lib/yaml/lib
interpreter = python
[zipsymlink]
recipe = svetlyak40wt.recipe.symlinks
path = ${app:src}
files = ${app:app-directory}/packages.zip
# Tools and dependencies
svetlyak40wt.recipe.symlinks = 0.2.1
私の app.yaml:
application: gaeapp
runtime: python27
threadsafe: true
api_version: 1
handlers:
- url: /_ah/spi/.*
script: gae_api.APPLICATION
libraries:
- name: pycrypto
version: latest
- name: endpoints
version: 1.0
- name: setuptools
version: latest
- name: webob
version: latest
- name: webapp2
version: latest
builtins:
- deferred: on
私の setup.py:
from setuptools import setup, find_packages
setup(
name = "gaeapp",
version = "1.0",
url = 'http://github.com/blabla/gaeapp',
license = 'BSD',
description = "Just a test GAE app.",
author = 'WOW',
packages = find_packages('src'),
package_dir = {'': 'src'},
install_requires = ['setuptools', 'pudb']
)
すべて正常にインストールされ、nosetests と devappserver は動作します。サーバーを実行します。
bin/devappserver parts/app
コードで pudb を使用しようとしています:
import pudb; pudb.set_trace();
そして、そのようなエラーを見てください:
ImportError: No module named pudb
GAE アプリで pudb を使用する方法はありますか?