Making yours the startup application
Normally when you see web2py the welcome
app appears:
As you know, the welcome
app is just any old web2py application. So how do you make yours the startup app? By creating a routes.py
file that points to it.
This example assumes there is no current routes.py
file in the web2py directory. If there is, make a backup copy of it.
Go to the web2py directory.
# Your web2py may be in a different location
$ cd /usr/local/web2py
Fire up your favorite text editor and write this short python script. Replace todo
with the directory name of your application. If following through this book as a tutorial just leave it as is.
# file: routes.py
routers = dict(
BASE = dict(
default_application='todo',
)
)
That's it. The next time you start web2py you'll see a new default application. It will come in handy when you point a domain name to your website.