模块可以并排放置。在
<module>.yaml为每一个可以是模块DIR内部。
关于app.yaml文件的注释具有误导性,它实际上仅适用于单模块应用程序(许多文档并未针对多模块应用程序进行更新)。
该default模块的配置文件中甚至没有被调用app.yaml(或称为其目录default)。我会保持应用程序级的配置文件(
cron.yaml,dispatch.yaml,queue.yaml和index.yaml)在顶层,最终符号链接它们到默认(或其他)模块(S)根据需要(有些工具可能另有抱怨)。
例如,这是我为一个应用程序所使用的结构(main目录包含default模块):
cron.yamldispatch.yamlqueue.yamlindex.yamlmain/cron.yaml -> ../cron.yamlmain/index.yaml -> ../index.yamlmain/main.yamlmain/queue.yaml -> ../queue.yamlbuildin/buildin.yamlbuildin/index.yaml -> ../index.yamlbuildin/queue.yaml-> ../queue.yaml
调用相关工具时只需注意。这是我从该应用程序的目录执行的该应用程序的备忘单,其中的一些内容也反映在pycharm项目配置中(我正在pycharm中运行开发服务器):
appcfg.py update main/main.yaml buildin/buildin.yamlappcfg.py update_dispatch .appcfg.py update_indexes -A <app-name> mainappcfg.py update_cron -A <app-name> .appcfg.py update_queues -A <app-name> .
要运行devserver:
dev_appserver.py --host 0.0.0.0 --log_level=debug dispatch.yaml main/main.yaml buildin/buildin.yaml
更新:根据要求添加了一些我的配置文件。
该dispatch.yaml文件,负责buildin在appspot域和我的自定义域上的模块路由(其他所有路由自动路由到默认模块):
application: <my_app>dispatch: - url: "buildin.my_domain.combuildin/*" module: buildin
该main.yaml文件中:
application: my_appmodule: defaultversion: 1runtime: python27api_version: 1threadsafe: truehandlers:- url: /(.*.min.css)$ static_files: stylesheets/1 upload: stylesheets/.*.min.css$ secure: always- url: /(.*.(ico|gif|png|jpg|svg))$ static_files: images/1 upload: images/.*.(ico|gif|png|jpg|svg)$ secure: always- url: .* script: main.app secure: alwayslibraries:- name: webapp2 version: "2.5.2"- name: jinja2 version: "2.6"- name: pycrypto version: "2.6"
该buildin.yaml文件中:
application: my_appmodule: buildinversion: 1runtime: python27api_version: 1threadsafe: trueinstance_class: B2handlers:- url: /(.*.min.js)$ static_files: scripts/1 upload: scripts/.*.min.js$ secure: always- url: /(.*.min.css)$ static_files: stylesheets/1 upload: stylesheets/.*.min.css$ secure: always- url: /(.*.(ico|gif|png|jpg|svg))$ static_files: images/1 upload: images/.*.(ico|gif|png|jpg|svg)$ secure: always- url: /buildin/cron* script: buildin.app login: admin- url: .* script: buildin.app secure: alwayslibraries:- name: webapp2 version: "2.5.2"- name: jinja2 version: "2.6"- name: pycrypto version: "2.6"



