Some of the information here may be outdated, please check the book instead


Here is a video by CJ.


(by coconutrandom)

You should have Putty by now, right? If not by all means get it form here You also need Firefox and Switchproxy.

1) log into your control panel and make your domain name

2)go to app and add a type "Custom Install script", click "View/hide script" and paste this:

#!/bin/env python2.4
import random
import sys

from webfaction.api import *

def create():
    # Create application.
    app = api.create_app(app_name, 'custom_app_with_port')

      # Download web2py.
      'wget -q;'
      'unzip -q;'

      'mv web2py/* .;'
       'python2.5 > /dev/null 2>&1;'

       # Cleanup
       'rmdir web2py/;'

    # Create
    start_web2py = """#!/bin/env python2.5

from gluon.main import HttpServer

""" % app
    api.write_file('', start_web2py)

    # Create cron job.
    api.create_cronjob('*/%s * * * * %s' % (1, cron_job))

    print app['id']

def delete():
    # Stop web2py.
    cmd = (
        'cd %s/webapps/%s/;'
        'ls > /dev/null 2>&1 && kill `cat` > /dev/null '
    api.system(cmd % (api.account['home_dir'], app_name))

    # Delete application and cron job.

if __name__ == '__main__':
    action, username, password, server, app_name, autostart,
    extra_info = sys.argv[1:]

    api = API(username, password, server)

    cron_job = (
      'cd %s/webapps/%s/;'
      'ls > /dev/null 2>&1 && ps -p `cat` > /dev/null '
      '2>&1 || /usr/local/bin/python2.5 > /dev/null 2>&1 &'
    ) % (api.account['home_dir'], app_name)

    except APIError, e:
        print e.message

3) Move your local password file,, into the web2py folder, replace XXXX with the port number.

4) go to Sites, add TWO new sites, one with http and one https. Both with your newly created App. They will need different names, but I just append an _s to the name of the https one.

5) Open Putty and type in your server name for a ssh connection, then under Connection > SSH > Tunnels add a Dynamic Port with the port of your newly created App.

6) Go back to Sessions and type a name for this session and Save it.

7) Connect!

7) In SwitchProxy go to Manage > Add > Standard type in SOCKS Proxy and your App port, IMPORTANT: Make sure you delete "localhost," from "No Proxy for" on the bottom.

8) Give it a label and Ok and select it to use

9) Now goto[YourAppPort]/

10) Profit!!

© 2008-2010 by Massimo Di Pierro - All rights reserved - Powered by web2py - design derived from a theme by the earlybird
The content of this book is released under the Artistic License 2.0 - Modified content cannot be reproduced.