Skip to content

hmleal/quicksilver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quicksilver

Another Python handmade web framework

Code style: black

Getting Started

Please don't use this in production

I've created this only to learn how to create a web framework from scratch.

Example

from quicksilver import Application
from quicksilver.http import BaseResponse as Response
from quicksilver.http import Route


def home(request):
    return Response("method: {0}".format(request.method))


def news(request, pk, slug):
    return Response("Params: {0} - {1}".format(pk, slug))


routes = (
    Route(r"^$", handler=home),
    Route(r"^news/(?P<pk>\d+)/(?P<slug>[-\w]+)/$", handler=news),
)

app = Application(routes=routes)


if __name__ == "__main__":
  from wsgiref.simple_server import make_server

  server = make_server("127.0.0.1", 8000, app)
  server.serve_forever()

About

Another Python handmade web framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published