Search code examples
web2py

URL in browser web2py


IS there way to launch application without specifying the URL in browser. e..g I have an app fordemo In view show.html and in controller default.py show method is there. I want to launch show.html page without specifying the /fordemo/default/show URL in browser.


Solution

  • My understanding is you want /fordemo/default/show to be the default function when you load up web2py, or when you enter your domain name on the browser. In that case you need to create a file called routes.py in your root web2py folder (the same place where web2py.py or web2py.exe is). In routes.py you'll need something like the following:

    #routes.py
    default_application = "fordemo"
    default_controller = "default"
    default_function = "show"
    

    You must restart web2py for changes to take affect.