I tried the example routes.py, routes_app from routes.example.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
routes_app = ((r'/(?P<app>welcome|admin|app)\b.*', r'\g<app>'),
              (r'(.*)', r'myapp'),
              (r'/?(.*)', r'myapp'))

I am restarting web2py between any changes. If I put a syntax error in, 
then it gets picked up, so it it being read.

I am running web2py on port 8002 on my local machine.
routes.py is in my web2py base directory.

http://127.0.0.1:8002/welcome

goes to the welcome app.

However  

http://127.0.0.1:8002/gallery goes to the gallery app

http://127.0.0.1:8002 goes to the welcome app

so the routes_app does not seem to be working. Any suggestions why not?

Eventually when I understand routes_app enough to get it working, I want to 
route according to domain. So as a test on my local machine I would like

http://127.0.0.1:8002 to route to welcome

but

http://localhost:8002 to route to admin

can anyone show me a routes_app that will achieve this. I have experimented 
with things like

(r'http://localhost:8002','admin')

to no avail but maybe this is because of the problem that is causing the 
example at the top of this post not to work.

Thanks for any help here.

Peter










-- 



Reply via email to