knife

项目地址:https://bitbucket.org/wowsoso/knife

功能分类:其他   技术分类:Web.py

更新时间:2011-07-10 07:06:10

用户关注:7038 次

用户评价:8 次 我来点评↓

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)

     

称呼(*)

网站

邮箱

填写右边的单词 simple

Copyright© Python4cn(news, jobs) simple-is-better.com, 技术驱动:powered by web.py 空间主机:Webfaction

版权申明:文章转载已注明出处,如有疑问请来信咨询。本站为 python 语言推广公益网站,与 python 官方没有任何关系。

联系/投搞/留言: en.simple.is.better@gmail.com 向本站捐赠