我需要幫助我的app.yaml
和網址管理。我有腳本ting.py
,searchandler.py
和toplawfirms.py
。我創建ting.py
第一,我在app.yaml
如何清理app.yaml,只留下每個腳本的首頁?
- url: /.*
script: ting.py
和所有其他網頁都在ting.py
聲明。但我認爲我在searchhandler.py
和toplawfirms.py
上犯了一個錯誤,因爲他們沒有成爲第二級別。有沒有辦法現在有app.yaml
只有三個腳本,這樣我app.yaml
看起來像
...
- url: /???
script: searchhandler.py
- url: /???
script: toplawfirms.py
- url: /.*
script: ting.py
...
,這樣我可以聲明在腳本中的所有其他網頁?
這是我現在有:
application: ting-1
version: 1
runtime: python
api_version: 1
handlers:
- url: /_ah/mail/.+
script: incoming.py
login: admin
- url: /stylesheets
static_dir: stylesheets
- url: /favicon.ico
static_files: static/images/favicon.ico
upload: static/images/favicon.ico
- url: /image
script: toplawfirms.py
- url: /imageupload
script: toplawfirms.py
- url: /imagesave
script: toplawfirms.py
- url: /imageresize
script: toplawfirms.py
- url: /displayimage
script: toplawfirms.py
- url: /histogram
script: toplawfirms.py
- url: /testurlopen
script: toplawfirms.py
- url: /printdb
script: toplawfirms.py
- url: /cropimage
script: toplawfirms.py
- url: /jquerytest
script: toplawfirms.py
- url: /urlopenppp
script: toplawfirms.py
- url: /deleteone
script: toplawfirms.py
- url: /enterppp
script: toplawfirms.py
- url: /saveppp
script: toplawfirms.py
- url: /searchhandler
script: searchhandler.py
- url: /site
script: searchhandler.py
- url: /searchall
script: searchall.py
- url: /.*
script: ting.py
inbound_services:
- mail
我應該刪除'高清的main(): run_wsgi_app(應用程序) 如果__name__ == 「__main__」: 的main()''從和searchhandler.py''toplawfirms.py',並把所有的處理程序,以'婷.py'或刪除'searchhandler.py'和'toplawfirms.py'並將其中的所有代碼轉移到'ting.py'並僅使用'ting.py'? – Zeynel
任何一個;你更喜歡哪個取決於你的應用程序。在前一種情況下,您應該在ting.py中引入'searchhandler'和'toplawfirms'以引用它們的處理程序。 –