运行dev_appserver.py时出现内部服务器错误

时间:2013-11-21 12:52:28

标签: django google-app-engine python-2.7 unity3d

我正在尝试将我的Unity Web Player应用程序上传到Google App Engine,但是当我使用dev_appserver.py启动服务器时,我在浏览Localhost页面时收到内部服务器错误 错误 服务器出错或无法执行请求的操作

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~gcdc2013-space3d/1.371793060412129756/main.py", line 27, in get
    self.response.out.write(template.render(path, template_values))
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/webapp/template.py", line 89, in render
    t = _load_internal_django(template_path, debug)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/webapp/template.py", line 163, in _load_internal_django
    template = django.template.loader.get_template(file_name)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/_internal/django/template/loader.py", line 157, in get_template
    template, origin = find_template(template_name)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/_internal/django/template/loader.py", line 138, in find_template
    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: WebPlayer.html   

我的app.yaml内容

application: gcdc2013-space3d
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /WebPlayer\.unity3d
  static_files: WebPlayer/WebPlayer.unity3d
  upload: WebPlayer/WebPlayer\.unity3d

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"

main.py内容

from google.appengine.ext.webapp import template
import webapp2
import os

class MainHandler(webapp2.RequestHandler):
    def get(self):
         template_values = {
            'greetings': 'greetings',
            }
         path = os.path.join('WebPlayer', 'WebPlayer.html')
         self.response.out.write(template.render(path, template_values))

app = webapp2.WSGIApplication([
    ('/', MainHandler)
], debug=True)

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

可能是因为Google数据存储区索引未及时更新。部署后稍等片刻,它应该可以工作。

见这里:https://stackoverflow.com/a/21965590/2137369