Reputation: 1094
In google App Engine, If I already have a page setup so everything gets redirected to main.py as shown below:
www.foobar.appspot.com/
will always go to main.py
the main.py is setup pretty much the same way as the hello world tutorial (except it calls some more functions that I wrote but that is irrelevant).
Now my question is, how can I set up multiple pages in the format of "Folders" or do anything with urls really... (I have not had much luck with reading through the documentation)
www.foobar.appspot.com/admin/
would go to a class or something, that would obviously handle all of the admin features (for now I would love a hello world). I really do not no, what script I would have that url go to, I am pretty clueless on urls with google App engine. I have seen posts where people had multiple classes in the main.py script but I could not figure out how to change the yaml file to accomidate that.
Upvotes: 2
Views: 112
Reputation: 15143
Your main.py will need to look at the URL and route it to whatever handler function you use.
This is a common task and most web frameworks have some way to handle it. For example, if you're using webapp2:
http://webapp-improved.appspot.com/guide/routing.html
Upvotes: 2
Reputation: 89847
URLs are mapped to python scripts in app.yaml
; the first regex you have in there that matches /admin will determine what's executed.
In the Python files themselves, you also need to handle the URLs that are dispatched to them (how you do this depends on what framework you're using; consult your documentation for how to do routing.)
Upvotes: 0