import web


# Map out the urls
urls = (
    '/', 'New'
)

# Define the web templates
t_globals = {
    'datestr': web.datestr,
    'len': len
}
render = web.template.render('templates', base='base', globals=t_globals)

# Create the web app and the sessions
app = web.application(urls, globals())


class New:
    ''' The page shown to new users to prompt a sign up'''
    def GET(self):
        return render.new()

class Refer:
    ''' 
    The page shown to users after they have signed up. This page tracks 
    referal counts and shows rewards
    '''
    def GET(self):
        return render.refer()

class PrivacyPolicy:
    ''' Show the user the privacy policy '''
    def GET(self):
        return render.private()

# Define some callbacks for page not founds
def notfound():
    ''' Create the not found page '''
    return web.notfound('Sorry, the page you were looking for was not found.')
    # You can use template result like below, either is ok:
    # return web.notfound(render.notfound())
    # return web.no
    # tfound(str(render.notfound()))

def internalerror():
    ''' Create the internal error page '''
    return web.internalerror('The server says: No soup for you!')

# Create the not found app
app.notfound = notfound
app.internalerror = internalerror

main = app.cgirun()
@@ -138,16 +138,29 @@
 : len%0A%7D%0A
+web.render = 
 render =
@@ -308,435 +308,8 @@
 ))%0A%0A
-%0Aclass New:%0A    ''' The page shown to new users to prompt a sign up'''%0A    def GET(self):%0A        return render.new()%0A%0Aclass Refer:%0A    ''' %0A    The page shown to users after they have signed up. This page tracks %0A    referal counts and shows rewards%0A    '''%0A    def GET(self):%0A        return render.refer()%0A%0Aclass PrivacyPolicy:%0A    ''' Show the user the privacy policy '''%0A    def GET(self):%0A        return render.private()%0A%0A
 # De
@@ -880,8 +880,9 @@
 cgirun()
+%0A

Remove view handlers from main app script