• <legend id='WG6Xf'><style id='WG6Xf'><dir id='WG6Xf'><q id='WG6Xf'></q></dir></style></legend>
    • <bdo id='WG6Xf'></bdo><ul id='WG6Xf'></ul>

    <small id='WG6Xf'></small><noframes id='WG6Xf'>

        <i id='WG6Xf'><tr id='WG6Xf'><dt id='WG6Xf'><q id='WG6Xf'><span id='WG6Xf'><b id='WG6Xf'><form id='WG6Xf'><ins id='WG6Xf'></ins><ul id='WG6Xf'></ul><sub id='WG6Xf'></sub></form><legend id='WG6Xf'></legend><bdo id='WG6Xf'><pre id='WG6Xf'><center id='WG6Xf'></center></pre></bdo></b><th id='WG6Xf'></th></span></q></dt></tr></i><div id='WG6Xf'><tfoot id='WG6Xf'></tfoot><dl id='WG6Xf'><fieldset id='WG6Xf'></fieldset></dl></div>

      1. <tfoot id='WG6Xf'></tfoot>
      2. GAE python中的YAML文件url和脚本

        时间:2023-09-13
      3. <tfoot id='f0uLv'></tfoot>

                <bdo id='f0uLv'></bdo><ul id='f0uLv'></ul>
                <legend id='f0uLv'><style id='f0uLv'><dir id='f0uLv'><q id='f0uLv'></q></dir></style></legend>

                    <tbody id='f0uLv'></tbody>
                1. <small id='f0uLv'></small><noframes id='f0uLv'>

                  <i id='f0uLv'><tr id='f0uLv'><dt id='f0uLv'><q id='f0uLv'><span id='f0uLv'><b id='f0uLv'><form id='f0uLv'><ins id='f0uLv'></ins><ul id='f0uLv'></ul><sub id='f0uLv'></sub></form><legend id='f0uLv'></legend><bdo id='f0uLv'><pre id='f0uLv'><center id='f0uLv'></center></pre></bdo></b><th id='f0uLv'></th></span></q></dt></tr></i><div id='f0uLv'><tfoot id='f0uLv'></tfoot><dl id='f0uLv'><fieldset id='f0uLv'></fieldset></dl></div>
                2. 本文介绍了GAE python中的YAML文件url和脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在 Google App Engine 中使用 Python 2.7,但似乎无法正确设置我的 app.yaml 文件.

                  I'm using Python 2.7 in Google App Engine and can't seem to get my app.yaml file set up right.

                  我的目标是,如果我去 http://localhost/carlos/ 我会得到一个已执行的 carlos.py

                  My goal is so that if I go to http://localhost/carlos/ I get an executed carlos.py

                  这是我的目录结构:

                  app
                     app.yaml
                     main.py
                     carlos.py
                  

                  这是我当前的 app.yaml 文件:

                  Here is my current app.yaml file:

                  application: myapp
                  version: 1
                  runtime: python27
                  api_version: 1
                  threadsafe: yes
                  
                  handlers:
                  - url: /carlos/.*
                    script: carlos.app
                  
                  - url: .*
                    script: main.app
                  

                  我的 carlos.py 文件是:

                  and my carlos.py file is:

                  import webapp2
                  
                  class MainHandler(webapp2.RequestHandler):
                    def get(self):
                      self.response.out.write("Hello, Carlos!")
                  
                  app = webapp2.WSGIApplication([('/carlos', MainHandler)],
                                                debug=True)
                  

                  但是我现在得到的只是 404 Not Found 错误.有什么想法吗?

                  However all I'm getting now is a 404 Not Found error. Any thoughts?

                  推荐答案

                  我能够确定解决方案并想把它发布给那里的任何人.

                  I was able to determine the solution and figured I'd post it for anyone out there.

                  在我需要替换的 carlos.py 文件中:

                  In my carlos.py file I needed to replace:

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

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

                  似乎 WSGIApplication 的第一个参数是指从您的根网址开始的 TOTAL 路径,而不是最初指向它的 INCREMENTAL 路径.

                  It appears that the first argument for the WSGIApplication is referring to the TOTAL path from your root web address as opposed to the INCREMENTAL path from which it was originally directed.

                  我选择这个答案而不是 Littm 提供的答案,因为我想继续使用 WSGI

                  I'm selecting this answer over what was provided by Littm because I'd like to keep using WSGI

                  这篇关于GAE python中的YAML文件url和脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何从 ruamel.yaml 转储的输出中删除 2 个空格? 下一篇:如何为 Google App Engine 应用程序编写 `app.yaml` 文件

                  相关文章

                  最新文章

                  <legend id='J1IZh'><style id='J1IZh'><dir id='J1IZh'><q id='J1IZh'></q></dir></style></legend>
                    <bdo id='J1IZh'></bdo><ul id='J1IZh'></ul>

                  <small id='J1IZh'></small><noframes id='J1IZh'>

                  <i id='J1IZh'><tr id='J1IZh'><dt id='J1IZh'><q id='J1IZh'><span id='J1IZh'><b id='J1IZh'><form id='J1IZh'><ins id='J1IZh'></ins><ul id='J1IZh'></ul><sub id='J1IZh'></sub></form><legend id='J1IZh'></legend><bdo id='J1IZh'><pre id='J1IZh'><center id='J1IZh'></center></pre></bdo></b><th id='J1IZh'></th></span></q></dt></tr></i><div id='J1IZh'><tfoot id='J1IZh'></tfoot><dl id='J1IZh'><fieldset id='J1IZh'></fieldset></dl></div>
                3. <tfoot id='J1IZh'></tfoot>