css - GAE : Why is my css not found?

标签 css google-app-engine yaml

使用此配置,我收到 HTTP 500 错误。

application: xxx
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /style
  static_dir: style


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

- url: /admin/.*
  script: google.appengine.ext.admin.application
  login: admin


- url: .*
  script: main.app


libraries:
- name: webapp2
  version: "2.5.2"

builtins:
- remote_api: on

虽然我的日志是这样说的:

INFO     2013-04-16 12:11:28,356 server.py:561] default: "GET /style/pimp_soef.css   HTTP/1.1" 500 2168

这是我的 HTML:

<link type="text/css" rel="stylesheet" href="/style/pimp_soef.css" />

我错过了什么?提前致谢!

编辑

我的 mainHandler 呢?与此有关!?

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

最佳答案

尝试直接在 URL 栏中输入 css 文件的 URL,这将让您确定问题不在于您的 HTML。

您的代码看起来是正确的。

我猜是另外一回事。文件名中的拼写错误。也许你有一个大写字母。或者您的目录结构未设置,因此无法找到/style。可能是文件权限。

关于css - GAE : Why is my css not found?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16036862/

相关文章:

html - col-md-6 在手机上没有响应

html - 表格中的文本换行,填充剩余宽度中间列

java - Google App Engine 查询在 Java 中不起作用

java - 以编程方式从 jar 中查找具有特定扩展名的所有资源

asp.net - 使用 Publish Pipeline Artifact 、下载 Pipeline Artifact 并部署到 Azure webapp 的正确方法

CSS3 : Hover effect with opacity on div's and text

css:当存在 float 元素时不会留边距

python - 从 Google App Engine Python 应用程序访问 Google 云端硬盘

php - 错误 400 : PHP 5. 4 个应用程序被阻止部署到 Google App Engine

php - 将配置从 service.yaml 移动到 Symfony5 中的另一个文件