0

ここに画像の説明を入力

私はすべての静的ファイルを自分と同じディレクトリに持っていますapp.yaml

ここで、静的ファイルを 1 つずつ特定する必要があります。app.yaml

application: xxx
version: 1
runtime: python
api_version: 1

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

- url: /style.css
  static_files: style.css
  upload: style.css

- url: /android.png
  static_files: android.png
  upload: android.png

- url: /logo.png
  static_files: logo.png
  upload: logo.png

- url: /helloworld.py
  script: helloworld.py

すべての静的ファイルを特定する簡単な方法はありますか? ( と同じディレクトリ レベルである場合app.yaml)

私は試します

- url: /
  static_files: index.html
  static_dir: \.
  upload: index.html

うまくいきません。

Fatal error when loading application configuration:
Unexpected attribute "static_dir" for mapping type static_files.
  in "C:\Projects\xxx-website\app.yaml", line 12, column 1
4

2 に答える 2

2

他の人が提案したように、ファイルを静的フォルダーに配置して、次のような app.yaml を作成できます (したがって、すべてのファイルを手動で入力する必要はありません): https://gist.github.com/3031499

次のように、上部に特定のハンドラを配置することもできます。

- url: /counter
  script: counter.app

- url: /(.*\.rar)
  script: download.app
于 2012-08-26T17:43:24.360 に答える
1

これをしようとする理由はありますか?それらをすべて static ディレクトリに配置します。

于 2012-08-26T16:12:03.733 に答える