コード例 #1
0
ファイル: app.py プロジェクト: break2017/lunar
from lunar.lunar import Lunar

app = Lunar('__main__')


@app.route('/', methods=["GET", "POST"])
def index():
    return "Hello, lunar!"


#/args?key=lunar&count=4
@app.route('/test_args', methods=["GET"])
def test_args():
    return app.request.args["key"], app.request.args["count"]


# template


@app.route('/template')
def template():
    return app.render('index.html')


@app.route('/template_with_noescape')
def test_escape():
    return app.render('test_escape.html', content="<p>hello escape</p>")


@app.route('/url_for_with_args')
def test_url_for_with_args():