more examples in routes.example.py

This commit is contained in:
mdipierro
2012-09-11 16:49:30 -05:00
parent 00eb0d8a85
commit 9a781c0f2b
2 changed files with 31 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.0.8 (2012-09-11 14:06:40) stable
Version 2.0.8 (2012-09-11 16:49:24) stable
+30 -5
View File
@@ -31,16 +31,41 @@ routes_app = ((r'/(?P<app>welcome|admin|app)\b.*', r'\g<app>'),
# routes_in=( (r'/static/(?P<file>[\w./-]+)', r'/init/static/\g<file>') )
#
routes_in = ((r'.*:/favicon.ico', r'/examples/static/favicon.ico'),
(r'.*:/robots.txt', r'/examples/static/robots.txt'),
((r'.*http://otherdomain.com.* (?P<any>.*)', r'/app/ctr\g<any>')))
BASE = '' # optonal prefix for incoming URLs
routes_in = (
# do not reroute admin unless you want to disable it
(BASE+'/admin/?$anything','/admin/$anything'),
# do not reroute appadmin unless you want to disable it
(BASE+'/$app/appadmin/?$anything','/$app/appadmin/$anything'),
# do not reroute static files
(BASE+'/$app/static/?$anything','/$app/static/$anything'),
# reroute favicon and robots, use exable for lack of better choice
('/favicon.ico', '/examples/static/favicon.ico'),
('/robots.txt', '/examples/static/robots.txt'),
# do other stuff
((r'.*http://otherdomain.com.* (?P<any>.*)', r'/app/ctr\g<any>')),
# remove the BASE prefix
(BASE+'/$anything','/$anything'),
)
# routes_out, like routes_in translates URL paths created with the web2py URL()
# function in the same manner that route_in translates inbound URL paths.
#
routes_out = ((r'.*http://otherdomain.com.* /app/ctr(?P<any>.*)', r'\g<any>'),
(r'/app(?P<any>.*)', r'\g<any>'))
routes_out = (
# do not reroute admin unless you want to disable it
('/admin/$anything', BASE+'/admin/?$anything'),
# do not reroute appadmin unless you want to disable it
('/$app/appadmin/$anything',BASE+'/$app/appadmin/?$anything'),
# do not reroute static files
('/$app/static/$anything', BASE+'/$app/static/?$anything'),
# do other stuff
(r'.*http://otherdomain.com.* /app/ctr(?P<any>.*)', r'\g<any>'),
(r'/app(?P<any>.*)', r'\g<any>'),
# restore the BASE prefix
('/$anything',BASE+'/$anything'),
)
# Specify log level for rewrite's debug logging
# Possible values: debug, info, warning, error, critical (loglevels),