Application init
When you deploy web2py, you will want to set a default application, i.e., the application that starts when there is an empty path in the URL, as in:
http://127.0.0.1:8000
By default, when confronted with an empty path, web2py looks for an application called init. If there is no init application it looks for an application called welcome.
The name of the default application can be changed from init to another name by setting default_application
in routes.py:
default_application = "myapp"
Note: default_application
first appeared in web2py version 1.83.
Here are four ways to set the default application:
- Call your default application “init”.
- Set
default_application
to your application’s name in routes.py - Make a symbolic link from “applications/init” to your application’s folder.
- Use URL rewrite as discussed in the next section.