Skip to content

jackuess/SinPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SinPy

Usage

Ẁith SinPy you can write web applications like this:

class Handler(HttpHandler):
    def get(self):
        return 'Serving GET /'

    def post(self):
        return 'Serving POST /'

    def put(self):
        return 'Serving PUT /'

    def delete(self):
        return 'Serving DELETE /'

application = Handler()

Subpages

class Handler(HttpHandler):
    a_page = response('Serving GET /a_page')
    another_page_html = response('Serving GET /another_page.html')
    yet_another = response(get='Serving GET /yet_another',
                           post='Serving POST /yet_another',
                           put='Serving PUT /yet_another'
                           delete='Serving DELETE /yet_another')

Subpages as decorators

class Handler(HttpHandler):
    @response
    def another_page_html(self):
        return 'Serving GET /another_page.html'

    @another_page_html.post
    def another_page_html(self):
        return 'Serving POST /another_page.html'

Static files

class Handler(HttpHandler):
    # GET /style.css
    style_css = static_file('css/style.css')

    # GET /static/*.html
    static = static_dir('static/*.html')

About

SinPy is a WSGI compatible micro web framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages