How to organize an application for applications

I want to create a directory structure as shown below. How can I get account.py and game.py to handle requests that go to \ account \ and \ game \ with respect. All the sample applications I've seen have all the logic on main.py that handle all the urls.

app\account\
           \account.py
   \game\
        \ game.py
   \static\css
          \js
          \images
   \app.yaml
   \main.py

I tried the following in app.yaml but this did not work

application: mefirst
version: 1
runtime: python
api_version: 1

handlers:

- url: /static
  static_dir: static

- url: /account
  script: account.py

- url: .*
  script: main.py
+3
source share
2 answers

MVCEngine, AppEngine, Ruby on Rails . , , MVCEngine.py, , , . .

+2

app.yaml:

- url: /account
  script: account/account.py

- url: /game
  script: game/game.py

- url: .*
  script: main.py

, ( : \) - , (, :/). - Windows ( - Python ), URL-, Unix-y- ( Linux MacOSX). , ", \account\and\game\respectfully", - , .

+11

Source: https://habr.com/ru/post/1729750/


All Articles