routes.py to app/controller/function/1/2/3

31 views
Skip to first unread message

Annet

unread,
Nov 1, 2021, 11:10:53 AM11/1/21
to web2py-users

I am developing a network application in web2py which consists of vertices and edges. Every vertex has a site which is dynamicalIy created within the init application. I added a domain and subdomains for my own domain to routes.py

routers = dict(

    # base router
    BASE = dict(
        domains = {
            'domain.com' : 'init',
            'www.domain.com' : 'init',
            'ldc.domain.com' : 'admin',
            'my.domain.com' : 'controlpanel',
        }
    ),
)


Someone asked me if he could point his domain to his site within the init application. I wonder whether that is possible. It would mean that for example I have to add thess domains to web2py's routes.py

'otherdomain.com': 'init/default/router/6'
'www.otherdomain.com: 'init/default/router/6'

where 'init' is the application, 'default' is the controller, 'router' is the function and '6' is the vertex ID, the router would then sets the args and redirects the request to 'init/main/index/6/1/5/24'which renders the site.

Is this possible?


Kind regards,

Annet
Reply all
Reply to author
Forward
0 new messages