Table of Contents

Installing Web2Py on DreamHost


Under construction!

$ cd ~
$ virtualenv python
$ source python/bin/activate
$ pip install requests  # needed by cams app and others
$ git clone --recursive https://github.com/web2py/web2py.git web2py.bikmort.com
$ cd ~/web2py.bikmort.com
$ git pull --recurse-submodules
$ cp handlers/wsgihandler.py passenger_wsgi.py
INTERP = os.path.join(os.environ['HOME'], 'python', 'bin', 'python')
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)

The Web2Py environment should now be operational. Visit the domain created earlier to see it.

Notes

Example: WDW

Sending Email from Web2Py Using Google G Suite

Remote Admin Access

These steps allow remote browser access to the Web2Py administrative control panels (both the master panel at admin as well as the app-specific panels at MYAPP/appadmin.

$ python web2py.py -p 443 -a "secret-secure-password"

This command will give errors (for among other reasons, a user process cannot listen on port 443), but it will have generated the necessary parameters_443.py file.

To redirect all accesses to be via https, there are two options:

  1. Use an .htaccess file to do a redirect as described by DreamHost here.
  2. Use Web2Py Auth(…, secure=True) setting, but note that this change breaks Travis CI testing.

In either case, there might be cached browser files that break the redirect, for example, redirecting http://www.mysite.com/myapp to https://www.mysite.com/public/myapp. Verify by opening an incognito window; fix by clearing cached files in the browser.

1)
You might prefer to go to github.com and create a fork of the Web2Py sources, then clone your fork. That's what all the cool kids do.