Ubuntu Server 13.10 と Python 2.7 を使用しています。
App Engine アプリケーションの 2 つのバージョン (admin バージョンとデフォルト バージョン) を使用したいと考えています。この 2 つのバージョンを定義しました。現在、これは私のapp.yaml
ファイルです:
application: application-id
version: 1
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: /
script: python.MainPage.application
- url: /test.*
script: gaeunit.application
libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest
version: admin
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: /.*
script: python.MainPage.application
login: admin
auth_fail_action: unauthorized
- url: /test.*
script: python.MainPage.appication
libraries:
- name: webapp2
version: latest
- name: jinja2
version: latest
このコードを App Engine にデプロイすると、期待どおりに動作します。ただし、Google Cloud SDK で見つかったものを使用して実行しようとするとdev_appserver.py
、次のトレースバックで失敗します。
Traceback (most recent call last):
File "/home/katie/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 82, in <module>
_run_file(__file__, globals())
File "/home/katie/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 78, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 902, in <module>
main()
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 895, in main
dev_server.start(options)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 672, in start
options.yaml_files)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 556, in __init__
module_configuration = ModuleConfiguration(yaml_path)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 82, in __init__
self._yaml_path)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/application_configuration.py", line 272, in _parse_configuration
return appinfo_includes.ParseAndReturnIncludePaths(f)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/api/appinfo_includes.py", line 63, in ParseAndReturnIncludePaths
appyaml = appinfo.LoadSingleAppInfo(appinfo_file)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/api/appinfo.py", line 1826, in LoadSingleAppInfo
listener.Parse(app_info)
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/api/yaml_listener.py", line 226, in Parse
self._HandleEvents(self._GenerateEventParameters(stream, loader_class))
File "/home/katie/google-cloud-sdk/platform/google_appengine/google/appengine/api/yaml_listener.py", line 177, in _HandleEvents
raise yaml_errors.EventError(e, event_object)
google.appengine.api.yaml_errors.EventError: Duplicate attribute 'version'.
in "aerobic-arcade-514/default/app.yaml", line 24, column 10