Skip to main content

Fast and simple micro web framework

Project description


$ pip install pysi

Hello world

import pysi

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:
    form = ProfileForm(rq.form)
    if rq.method == 'POST' and form.validate():
        rq.flash('Profile updated', 'success')
        return redirect('profile.edit')
    return {'form': form, 'post': post}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysi-0.19.0.tar.gz (14.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page