Я пытаюсь загрузить приложение Unity Web Player в Google App Engine, но когда я запускаю сервер с помощью dev_appserver.py, я получаю ошибку внутреннего сервера при просмотре страницы Localhost Ошибка сервер либо допустил ошибку или неспособен выполнить запрошенную операциюОшибка внутреннего сервера во время работы dev_appserver.py
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)
любая помощь будет оценена
IIRC вы должны иметь template.html в директории под названием шаблонов. Это то, что по умолчанию для webapp2/jinja2, поэтому стоит попробовать. –