Skip to content

Instantly share code, notes, and snippets.

@fanzeyi
Created August 5, 2011 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanzeyi/1127695 to your computer and use it in GitHub Desktop.
Save fanzeyi/1127695 to your computer and use it in GitHub Desktop.
Basic Web.py Project
# -*- coding: utf-8 -*-
import web
from urls import urls
from render import render
web.config.debug = True
app = web.application(urls, globals())
class HomeHandler(object):
def GET(self):
home = True
title = u'首页'
return render.index(locals())
application = app.wsgifunc()
# -*- coding: utf-8 -*-
import os
import sys
from web.contrib.template import render_jinja
BasePATH = os.path.dirname(__file__)
render = render_jinja(os.path.join(BasePATH, 'tpl'),
encoding = 'utf-8')
# -*- coding: utf-8 -*-
urls = (
'/', 'HomeHandler'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment