Don't mix the two router styles.

You can set default_application/controller/function outside the context of a 
router; see routes.example.com.

On 20 May 2013, at 5:48 PM, Júlia Rizza <[email protected]> wrote:

> So I have this on my routes.py:
> 
> routers = dict(
>     BASE = dict(
>         default_application = 'kolaborativa',
>         default_controller = 'default',
>         default_function = 'index'
>         ),
>     )
> 
> routes_in = (
>     # do not reroute admin unless you want to disable it
>     (BASE + '/admin', '/admin/default/index'),
>     (BASE + '/admin/$anything', '/admin/$anything'),
>     # do not reroute appadmin unless you want to disable it
>     (BASE + '/$app/appadmin', '/$app/appadmin/index'),
>     (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
>     ('/$username', BASE + 'user_info/$username'),
> )
> 
> 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
>     (BASE + 'user_info/$username', '/$username'),
> )
> 
> This way I still need to access http://localhost:8000/user_info/username to 
> see the user profile and I want to access just http://localhost:8000/username.
> Can someone help me?
> 
> 
> -- 
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to