Python google引擎(进程已退出,代码为1)

Python google引擎(进程已退出,代码为1),python,django,google-app-engine,python-2.7,Python,Django,Google App Engine,Python 2.7,我试图在谷歌应用程序引擎中运行以下代码 //app.yaml application: engineapp version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: /favicon\.ico static_files: favicon.ico upload: favicon\.i

我试图在谷歌应用程序引擎中运行以下代码

//app.yaml
      application: engineapp
      version: 1
      runtime: python27
      api_version: 1
      threadsafe: yes

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

       - url: .*
         script: main.app

        libraries:
       - name: webapp2
        version: "2.5.2"
       - name: jinja2
       version: "2.7"
       - name: markupsafe
      version: "0.18"


       #main.py

       import datetime
       import jinja2
       import os
       import webapp2
       from google.appengine.api import users
       template_env = jinja2.Environment(
       loader=jinja2.FileSystemLoader(os.getcwd()))
       class MainPage(webapp2.RequestHandler):
      def get(self):
      current_time = datetime.datetime.now()
      user = users.get_current_user()
      login_url = users.create_login_url(self.request.path)
      logout_url = users.create_logout_url(self.request.path)
      template = template_env.get_template('home.html')
      context = {
     'current_time': current_time,
      'user': user,
      'login_url': login_url,
     'logout_url': logout_url,
       }
        self.response.out.write(template.render(context))
        application = webapp2.WSGIApplication([('/', MainPage)],
      debug=True)


       #home.html
      <html>
      <head>
      <title>The Time Is...</title>
      </head>
      <body>
      {% if user %}
      <p>
      Welcome, {{ user.email() }}!
      You can <a href="{{ logout_url }}">sign out</a>.
      </p>
      {% else %}
      <p>
      Welcome!
      <a href="{{ login_url }}">Sign in or register</a> to customize.
      </p>
      {% endif %}
      <p>The time is: {{ current_time }}</p>
      </body>
      </html>

请帮帮我,谢谢你的时间。

问题出在你的app.yaml文件中:它没有正确缩进。特别是markupsafe版本声明。试试这个:

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

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"
- name: jinja2
  version: "2.7"
- name: markupsafe
  version: "0.18"
handlers
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"
- name: jinja2
  version: "2.7"
- name: markupsafe
  version: "0.18"