shot is Python super micro web framework. It is designed to be super fast and super easy to use for writing simple tasks.
Features:
- parametrized routing
- builtin Jinja-like template engine
- dev web server
- batteries for creating simple REST API.
- it can be used with SQLAlchemy as ORM.
- routing - YES
- wrapping REQUEST (GET/POST, form multipart data) - YES
- template engine - YES
- dev server - YES
- parametrized routing - YES
- reloading dev server in DEBUG - NO
- Docs - NO
- REST API batteries - NO
- ORM integration batteries - NO
pip install shot, gunicorn- Example "prog.py":
from shot import application, route, render, run
@route('/')
def main(request):
return "Hello World"
@route('/name')
def example(request):
context = dict(
name = 'John Stark',
brothers = ['Rickon', 'Bran', 'Robb']
)
return render('example.html', context)
if __name__ == '__main__':
run()- Template
'templates/example.html':
{% extends 'main.html' %}
{% block contents %}
<p>Hello, {{ name|capitalize }}
Your brothers:
<ul>
{% for brother in brothers %}
<li>Brother number {{ loopcounter }}: {{ brother }} </li>
{% empty %}
... sorry, you don't have any left.
{% endfor %}
</ul>
{% endblock %}- Running:
python prog.pyor
gunicorn prog- The web app will be hosted at
http://127.0.0.1:8000/
- Dev server ---> 0.5
- Extended routing rules ---> 0.6
- ORM ---> 0.7
- REST --- 0.8
... Will be here soon ...