【问题标题】:Broken link images in python google app enginepython 谷歌应用引擎中的链接图像损坏
【发布时间】:2011-03-13 21:19:16
【问题描述】:

您好,我曾多次尝试使用 python/google 应用引擎制作图片链接,但仍然显示链接损坏。

我的根文件夹中有包含我想要的图像的文件夹图像。

我的 app.yaml 文件:

handlers:

    - url: /.*
      script: helloworld.py

    - url: /images
      static_dir: images 

我的 index.html:

img src="images/_image01.gif" 

【问题讨论】:

    标签: python image google-app-engine


    【解决方案1】:

    处理程序按顺序匹配。 /.* 将匹配任何 URL,因此您的 /images 处理程序将永远不会匹配。颠倒它们的顺序,始终将/.* 处理程序放在 app.yaml 的最后。

    【讨论】:

      【解决方案2】:

      我认为您在 html 文件中的静态路径开头缺少“/”。试试:

      img src="/images/_image01.gif" 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-09-06
        • 2012-06-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多