Copyright 2016 SweetPalma <sweet.palma@yandex.ru>
Perver is a small experimental web-framework with embedded async server. You just download it, include it and run it. And it just works - no other dependencies but Python Standart Library. Sounds easy? Take a look at example then:
Download this into your working directory. Dont forget, you need Python 3.4 or newer. Done, you're ready to go.
P.S. If your browser doesn't download it, simply displaying a text file - press on that link with right mouse button and choose "Save As".
from perver import Perver
server = Perver()
@server.route('/')
def page_main(self):
return self.redirect('/hello/perverts')
@server.route('/hello/{name}')
def page_hello(self, name):
return 'Hello, ' + name
server.start('', 80)
Make a script or paste that in your Python console. Now open your localhost - and magic will happen! You can even type something different - if you like classical 'Hello World' more.
- Server: You don't need any other server to test your code. Perfect for small projects and prototyping.
- Asynchronous: It uses non-blocking IO, forget about creepy one-client issues in small frameworks.
- Routing:: Requests to function-call mapping for clean and dynamic URLs.
- Utilities: Batteries included - POST/GET, cookies, headers and other HTTP-related data.
See the LICENSE file for more information. And don't use my perverted python logo for anything else, please.
Hardly inspired by BottlePy.