Google AppEngine app.yaml 错误 500
我在将资产文件夹上传到根目录时遇到问题,但也允许自定义 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
以查看是否可以通过这种方式覆盖它。
知道为什么会发生这种情况以及如何解决它吗?
I'm having problems getting my assets folder to upload to the root, but also allowing a custom url handler /cron
to upload too.
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
As you can see, my backup script is also located in my assets or static folder. If I remove my static_dir: assets
handler, my /cron
handler works fine.
I also tried changing the url
to /assets
to see if I could overwrite it that way.
Any idea why this happens and how I can fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用
static_dir: assets
将整个资产目录定义为静态。您无法在 static_dir 内运行任何脚本。解决方法是将assets/backup/main.py
移动到定义为 static_dir 的目录之外。You are defining the whole assets directory as static with
static_dir: assets
. You can't run any script inside a static_dir. The fix is to moveassets/backup/main.py
to outside the directory defined as static_dir.