skip to navigation
skip to content

Not Logged In

pysi 0.14.0

Fast and simple micro web framework

Latest Version: 0.18.0

Installation

$ pip install pysi

Hello world

import pysi

@pysi.view('/')
def home(rq):
    return 'Hello world!'

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    make_server('', 8000, pysi.App()).serve_forever()

Another example

from pysi import cfg, view, redirect, abort
from models import Profile
from forms import ProfileForm

@view('/profile/<int:id>/edit/', 'profile/edit.html')
def edit(rq, id):
    obj = Profile.get(id)
    if not obj or obj.user != rq.user:
        abort(404)
    form = ProfileForm(rq.form)
    if rq.method == 'POST' and form.validate():
        form.populate_obj(obj)
        obj.save()
        rq.flash('Profile updated', 'success')
        return redirect('profile.edit')
    return {'form': form, 'post': post}
 
File Type Py Version Uploaded on Size
pysi-0.14.0.tar.gz (md5) Source 2013-01-25 14KB
  • Downloads (All Versions):
  • 3 downloads in the last day
  • 450 downloads in the last week
  • 2386 downloads in the last month