Created
August 5, 2011 14:56
-
-
Save fanzeyi/1127695 to your computer and use it in GitHub Desktop.
Basic Web.py Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
urls = ( | |
'/', 'HomeHandler' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment