コード例 #1
0
ファイル: test_muxi_session.py プロジェクト: wanzifa/muxi
"""
	test_muxi_session.py
	~~~~~~~~~~~~~~~~~~~~

		test session

"""

from muxi import session
from muxi import Muxi
from muxi import views, url, redirect, gen_url, request


app = Muxi(__name__)
app.secret_key = 'I love muxi'


@url(app, "/index")
# @views("index.html")  # name
def index():
	# app.secret_key = 'I love muxi'
	session["username"] = "******"
	return "<h1>Hello %s</h1>" % session['username']
	# return "%s" % str(request.cookies)
	# name = request.args.get("name")
	# return "name = %s" % name
	# return "en..."

# so, I use session, but this session can not store anything !
コード例 #2
0
ファイル: test_muxi_app.py プロジェクト: wanzifa/muxi
# coding: utf-8

"""
	test_muxi_app.py
	~~~~~~~~~~~~~~~~

		test create muxi app
"""

from muxi import Muxi


app = Muxi(__name__)
app.secret_key = "I love muxi"


@app.url('/muxi')
def muxi():
	return "<h1>hello muxi</h1>"


if __name__ == "__main__":
	app.run(debug=True)