【问题标题】:Google AppEngine app.yaml error 500谷歌 AppEngine app.yaml 错误 500
【发布时间】:2011-08-24 17:52:34
【问题描述】:

我在将资产文件夹上传到根目录时遇到问题,但也允许自定义 url 处理程序 /cron 上传。

application: appname
version: 1
runtime: python
api_version: 1

handlers:
- url: /cron
  script: assets/backup/main.py

- url: /
  static_files: assets/index.html
  upload: assets/index.html

- url: /
  static_dir: assets

如您所见,我的备份脚本也位于我的资产或 static 文件夹中。如果我删除我的static_dir: assets 处理程序,我的/cron 处理程序工作正常。

我还尝试将url 更改为/assets,看看是否可以这样覆盖它。

知道为什么会发生这种情况以及如何解决吗?

【问题讨论】:

    标签: google-app-engine yaml handler


    【解决方案1】:

    您正在使用static_dir: assets 将整个资产目录定义为静态目录。您不能在 static_dir 中运行任何脚本。解决方法是将assets/backup/main.py 移动到定义为static_dir 的目录之外。

    【讨论】:

    • 完美!谢谢莫拉斯。一切都说得通,脚本不是静态内容!
    猜你喜欢
    • 2017-06-23
    • 1970-01-01
    • 1970-01-01
    • 2014-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多