routes_out is used when mapping a URL('controller','function') into an
actual url. It is called reversed routing in other frameworks.
On Sunday, 27 August 2017 17:49:47 UTC-5, Alfonso Serra wrote:
>
> Simpler and better approach:
>
> 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')
>
> # default controller
> , ('/', '/%s/default/index' % default_application)
> , ('/$c', '/%s/$c/index' % default_application)
> , ('/$c/$f', '/%s/$c/$f' % default_application)
> , ('/$anything', '/%s/static/$anything' % default_application)
> , (BASE + '/$anything', '/$anything')
> ]
>
> 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')
> )
>
> Works well, when a static file is not found i get the http right code. I
> have to put aside web2py default autoroutes but this is what i wanted.
>
> I still dont quite get routes_out, when is a route coming from the app? is
> it only on redirections? Thanks.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.