<bdo id='aaMfD'></bdo><ul id='aaMfD'></ul>

  1. <legend id='aaMfD'><style id='aaMfD'><dir id='aaMfD'><q id='aaMfD'></q></dir></style></legend>
    <tfoot id='aaMfD'></tfoot>

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

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

      在 Google 应用引擎 Python 中提供静态 html

      时间:2023-09-07
      <tfoot id='SSxBe'></tfoot>

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

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

          • <legend id='SSxBe'><style id='SSxBe'><dir id='SSxBe'><q id='SSxBe'></q></dir></style></legend>
              <tbody id='SSxBe'></tbody>
              • <bdo id='SSxBe'></bdo><ul id='SSxBe'></ul>
                本文介绍了在 Google 应用引擎 Python 中提供静态 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我在为我的 Python 加载静态 .html 页面时遇到问题应用程序.当我单击 index.html 之类的链接时,我得到一个空白页面,并且在服务器上记录了 404 错误.其他静态 .html 文件也是如此,例如 about.html.

                I'm having trouble getting static .html pages loaded for my Python app. When I click on a link like index.html, I get a blank page and on the server log a 404 error. This is the same for other static .html files such as about.html.

                应用程序可以在静态文件中运行.我试过看很多地方,但我似乎无法获得 .html 页面.即

                The application works bar the static files. I've tried looking in numerous places, but I cannot seem to get the .html pages up. i.e.

                信息 2011-04-16 17:26:33,655 dev_appserver.py:3317] 获取/terms.html HTTP/1.1" 404 -

                INFO 2011-04-16 17:26:33,655 dev_appserver.py:3317] "GET / terms.html HTTP/1.1" 404 -

                yaml:

                application: quote
                version: 1
                runtime: python
                api_version: 1
                
                handlers:
                
                - url: /index.html
                script: index.py
                
                - url: /
                script: index.py
                
                - url: /(.*.(html))
                static_files: static/1
                upload: static/HTML/(.*.(html))
                
                
                - url: /favicon.ico
                static_files: static/images/favicon.ico
                upload: images/favicon.ico
                mime_type: image/x-icon
                
                - url: /css
                static_dir: static/css
                
                - url: /images
                static_dir: static/images
                
                - url: /js
                static_dir: static/js
                

                我的静态文件位于 static/HTML 中,index.html 位于主文件夹中.

                My static files are located in static/HTML and index.html is in the main folder.

                这个我也试过了,但是好像没什么区别:

                I have also tried this, but it seems to make no difference at all:

                - url: /favicon.ico
                  static_files: static/images/favicon.ico
                  upload: images/favicon.ico
                  mime_type: image/x-icon
                
                - url: /css
                  static_dir: static/css
                
                - url: /images
                  static_dir: static/images
                
                 - url: /js
                  static_dir: static/js
                
                 - url: /(.*.(html))
                  static_files: static/1
                  upload: static/HTML/(.*.(html))
                
                 - url: /index.html
                  script: index.py
                
                 - url: /
                 script: index.py
                

                推荐答案

                将您的 HandlerScripts 保持在静态目录处理部分之下.IOW,把它移到最后.

                Keep your HandlerScripts below the Static Directory handling portion. IOW, just move this to the last.

                - url: /index.html
                script: index.py
                
                - url: /
                script: index.py
                

                这篇关于在 Google 应用引擎 Python 中提供静态 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在 JavaScript 中将 JSON 转换为 YAML 下一篇:支持转储和加载的纯 Javascript YAML 库?

                相关文章

                最新文章

                  <legend id='Tvy40'><style id='Tvy40'><dir id='Tvy40'><q id='Tvy40'></q></dir></style></legend>
                    <bdo id='Tvy40'></bdo><ul id='Tvy40'></ul>
                1. <tfoot id='Tvy40'></tfoot>
                  <i id='Tvy40'><tr id='Tvy40'><dt id='Tvy40'><q id='Tvy40'><span id='Tvy40'><b id='Tvy40'><form id='Tvy40'><ins id='Tvy40'></ins><ul id='Tvy40'></ul><sub id='Tvy40'></sub></form><legend id='Tvy40'></legend><bdo id='Tvy40'><pre id='Tvy40'><center id='Tvy40'></center></pre></bdo></b><th id='Tvy40'></th></span></q></dt></tr></i><div id='Tvy40'><tfoot id='Tvy40'></tfoot><dl id='Tvy40'><fieldset id='Tvy40'></fieldset></dl></div>
                  1. <small id='Tvy40'></small><noframes id='Tvy40'>