web2py 2.x

Hi what is the easiest/best way to upgrade to the new 2.x version?

I have nothing I need to save.


You can easily fix by yourself the upgrade script as described in and then reload the web app. The upgrade button will be available in the administrative interface ;-)

The upgrade to 2.0.8 seems to work fine, except for a ticket error at the end of the upgrade that hangs the application until you reload the web app again.

We'll be adding proper support for web2py 2.0 soon (we were holding off until the developers said it was definitely safe) but in the meantime, here's a script that will work:

In a bash console, run the following commands, replacing APASSWORD with the admin password you want to use in the last line:

  • cd ~
  • mv web2py web2py.old
  • wget
  • unzip
  • cd web2py
  • python -c "from gluon.widget import console; console();"
  • python -c "import hashlib; print 'password=\"%s\"' % (hashlib.md5('APASSWORD').hexdigest(),)" >

Next, edit the file /var/www/ in your sandbox, and put in the following (if anyone apart from iconfly is following these instructions, note that you'll need to adjust the project_home setting:

import os
import sys

# add your project directory to the sys.path
project_home = "/home/iconfly/web2py"
if project_home not in sys.path:
    sys.path = [project_home] + sys.path

sys.stdout = sys.stderr

# serve web2py via WSGI handler
from gluon.main import wsgibase as application

Once you've done that, reload the web app and everything should work fine.

Ah, just saw nicozanf's post -- that should work too :-)

Thanks! got it running locally, might wait for PA upgrade.