routes_in = ( (r'/', r'/bs3b/default/index'), (r'/about', r'/bs3b/default/about'), (r'/what', r'/bs3b/default/what'), (r'/download', r'/bs3b/default/download'), (r'/support', r'/bs3b/default/support'), (r'/$anything', r'/bs3b/$anything'), )
routes_out = [(x, y) for (y, x) in routes_in] my app is bs3b - C:\web2py-m\applications\bs3b\routes.py четверг, 13 июня 2013 г., 16:20:22 UTC+3 пользователь Loïc написал: > > In your web2py root folder, you have a base routes.py > for example in the base routes.py you define your two applications app1 > and app2 : > > # -*- coding: utf-8 -*- > #app1 > routes_app = ( > (r'.*?:https?://www.app1.com:\w* /$anything', r'app1'), > (r'.*?:https?://app1.com:\w* /$anything', r'app1') > ) > #app2 > routes_app += ( > (r'.*?:https?://www.app2.net:\w* /$anything', r'app2'), > (r'.*?:https?://app2.net:\w* /$anything', r'app2') > ) > > > Then in your application folder (app1 & app2) you have an other routes.py > which will be used in place of base routes.py for this app. For example > In app1 folder : > > # -*- coding: utf-8 -*- > routes_in = ( > (r'/', r'/app1/default/index'), > (r'/images', r'/app1/images/images_list'), > (r'/contact', r'/app1/default/contact_form'), > ) > > routes_out = [(x, y) for (y, x) in routes_in] > > > > > Le jeudi 13 juin 2013 14:04:39 UTC+2, Júlia Rizza a écrit : >> >> I was reading about the specific routes of applications in the book >> <http://web2py.com/books/default/chapter/29/04#Pattern-based-system> >> section Application-Specific URL rewrite, but didn't understand well how it >> works. Could someone explain for me how routes_app create a routes.py >> specific in each app and, if possible, give me an example? >> > -- 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.

