knife
Example
view:
hello = lambda req : get_resp("hello world")
hello = lambda req : render("hello.html",{"name":"wososo"})
hello = lambda req : redirect("/")
settings example(route,session and more):
touch setting.py
from wsgilog import log
from wsgistate.memory import session
config = {
"host" : "127.0.0.1",
"port" : 8001,
"middlewares" : [
log(tohtml=True, tofile="wsgi.log", tostream=True, toprint=True),
session()
],
"mapping" : [
#example:('^/hello/(?P.+)$', ('', 'view name')),
]
}
build-in template engine:
like django, but only provited if,else,for.
if you want use jinja2 or more,please extend in settings.py(rewrite get_tpl function)
nginx+uwsgi:
views:views.py
uwsgi --module views --callable get_app -s /tmp/knife.socket -C 664
nginx conf:
location / {
include : uwsgi_params;
uwsgi_pass : unix:///tmp/knife.socket;
}
我是作者,想要修改项目内容?把修改内容发到联系邮箱(看最底部)

用户评价 (8)