I want to have an structure like this
http://localhost:8080/
http://localhost:8080/problem2/
http://localhost:8080/problem3/
...
I also want a python structure like this
-src
- app.yaml
- main.py
- package_problem_2
- main.py
- package_problem_3
- main.py
I would like to have differents main.py for the differents folder in my web.
I mean, if I am in http://mydomain:8080
it is src/main.py
the want that handle the requests. But, if I am in http://localhost:8080/problem2
it should be package_problem_2/main.py
the one which handle the requests.
Is this possible?
Are you using webapp2 framework?
If so, read on...
You need four files. For simplicity, all are located in the root folder of your app:
on your app.yaml, you should have something like this:
That tells appengine to route all url patterns to urls.py.
Then on your urls.py, you have this structure:
On your problem, you have three structures: /, /problem2, /problem3. They would correspond to these:
It's up to you to decide if they go to the same handler or not.
SampleController.py looks like this:
Notice they all go to the same Sample.html file.
Sample.html is just standard html code.