My Pyramid アプリは、貼り付け httpserver 内で実行すると正常に動作しますが、Google アプリ エンジンで例外がスローされます。
/hello/{name} URL は、貼り付けサーバーとアプリ エンジンの両方で正常に機能します
/test URL は貼り付けサーバーでは正常に機能しますが、アプリ エンジンでは以下のトレースバックが表示されます。
何か案は?
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello %(name)s!' % request.matchdict)
def test(request):
return dict()
settings = {'mako.directories':'mako_templates'}
config = Configurator(settings=settings)
config.add_route('hello', '/hello/{name}')
config.add_route('test', '/test', view=test, renderer='test.mako')
config.add_view(hello_world, route_name='hello')
wsgi_app = config.make_wsgi_app()
Google アプリ エンジンからのトレースバック:
ERROR 2013-01-17 02:48:08,893 wsgi.py:235]
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 223, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/router.py", line 251, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/router.py", line 227, in invoke_subrequest
response = handle_request(request)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/router.py", line 161, in handle_request
response = view_callable(context, request)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/config/views.py", line 367, in rendered_view
context)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/renderers.py", line 531, in render_view
return self.render_to_response(response, system, request=request)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/renderers.py", line 561, in render_to_response
result = self.render(value, system_values, request=request)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/renderers.py", line 534, in render
renderer = self.renderer
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/decorator.py", line 39, in __get__
val = self.wrapped(inst)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/renderers.py", line 518, in renderer
return factory(self)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/mako_templating.py", line 129, in __call__
directories = [ abspath_from_asset_spec(d) for d in directories ]
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pyramid/asset.py", line 43, in abspath_from_asset_spec
return pkg_resources.resource_filename(pname, filename)
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pkg_resources.py", line 840, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/Users/mnaber/Documents/workspace/UnifiedClassified/site-packages/pkg_resources.py", line 160, in get_provider
__import__(moduleOrReq)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 692, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1766, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 692, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1630, in FindAndLoadModule
description)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 692, in Decorate
return func(self, *args, **kwargs)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1577, in LoadModuleRestricted
description)
ImportError: Cannot re-init internal module __main__
INFO 2013-01-17 02:48:08,909 dev_appserver.py:3103] "GET /test HTTP/1.1" 500 -