다른 URL을 다른 python 스크립트에 매핑하려고합니다. 내가 http://myapp.appspot.com/test에 가면 gae & python - yaml에 다른 URL 설정 : 404 찾을 수 없음
이
내 YAMLapplication: myApp
version: 99
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /deleteCustomers
script: test.app
- url: /.*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
builtins:
- remote_api: on
, 그것은
내가 http://myapp.appspot.com에 가면 오른쪽 스크립트가 실행됩니다 (main.app) ... "404 찾을 수 없습니다"라는여기에 내가 가지고있는 동일한 문제입니다 ->HERE 하지만 주어진 솔루션은 나를 위해 작동하지 않습니다 (이 같은 코드의 경우에도!)
여기 (이하 "이 경로 YAML"를 테스트하는 핸들러입니다,고객 및 저장소 클래스와 mainhandler를 보유하고있는 main.app를 test.app로 이름을 바꾸어 복제했습니다.
http://www.myapp.appspot.com/deleteCustomers 및 http://www.myapp.appspot.com/deleteStores
감사를 들어 : 그래서 main.app 및 test.app 모두 내가 두 개의 별도의 전화로 고객과 상점 삭제를 분할 달성하고 싶은 무엇
class MainHandler(webapp2.RequestHandler):
def get(self):
customers = Customers.all()
stores = Stores.all()
countCustomers= 0
countStores= 0
for p in customers:
p.delete()
countCustomers+= 1
for p in stores:
p.delete()
countStores+= 1
self.response.out.write("\nDeleted Customers: " + str(countCustomers))
self.response.out.write("\nDeleted Stores: " + str(countStores))
app = webapp2.WSGIApplication([
('/', MainHandler)
], debug=True)
)과 동일하다 모든 도움을 미리, 최고의 안부
시도해보십시오. url : /test.* 또한 처리기와 라우터를 테스트 처리기에 게시 할 수 있습니까? – Tkingovr
작동하지 않습니다. | – BeNdErR
테스트 앱에 코드를 게시 할 수 있습니까? – Tkingovr