Affichage des articles dont le libellé est bottle. Afficher tous les articles
Affichage des articles dont le libellé est bottle. Afficher tous les articles

lundi 27 janvier 2014

[Bottle + Tornado] From a Bottle application, sending parameters to the Tornado server

When you use Bottle + Tornado (or CherryPy,... etc...), you can give options to the Tornado server, by declaring them inside the Bottle run(...) method.

Here hello_bottle.py :

from bottle import route, run, template
import os

@route('/hello/<name>')
def index(name):
    return template('<b>Hello {{name}}</b>!', name=name)

data_dir='/'

#we give ssl_options to the Tornado server :
run(host='localhost', port=8080,server='tornado',ssl_options={
    "certfile": os.path.join(data_dir, "mydomain.crt"),
    "keyfile": os.path.join(data_dir, "mydomain.key"),
})

And when we execute :

python hello_bottle.py

Bottle v0.13-dev server starting up (using TornadoServer(ssl_options={'keyfile': '/mydomain.key', 'certfile': '/mydomain.crt'}))...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.

Voila :o)


Source : 
SSL with Tornado :

Sending parameters to CherryPy:

Servers allowed with Bottle :

mercredi 19 juin 2013

Bottle Restful - Links


http://nongraphical.com/2012/08/using-bottle-py-in-production/

http://www.marginhound.com/bottle-py-resources/

http://myadventuresincoding.wordpress.com/2011/01/02/creating-a-rest-api-in-python-using-bottle-and-mongodb/

http://mark-kirby.co.uk/2013/creating-a-true-rest-api/

http://gotofritz.net/blog/weekly-challenge/restful-python-api-bottle/

mercredi 29 août 2012

Configure NginX and Bottle

Very simple article : http://kjuly.me/note/nginx-uwsgi-bottle/

Thanks to Kjuly :o)

Who uses cherrypy and web2py ? [updated]


I'm a little afraid on the future of CherryPy because :

- there are no new commits since April
- new issues are not assigned since April too
- the page on cherrypy.org detailing the websites running with CherryPy is very poor : http://docs.cherrypy.org/stable/appendix/success.html
- the last commits has been made only by Jason R. Coombs (only 1 person !)

Then I ask me some questions and I have some serious doubts.

Maybe it s time to choose a new framework... Maybe web2py. Why web2py ? Because when I look at this page I'm very impressed by the number of websites using web2py.
But it seems that the project is only maintained by Massimo Di Pierro (the creator). Bad point :o(

In conclusion : if you know a robust framework for Python 3, tell me ! :o)

[update] I realize that web2py doesn't support Python 3 :o( 
Flask doesn't support too.

[update] Bottle supports Python 3. Not a lot of commits, but issues are maintained/followed.

[update] Pyramid seems to be a serious framework (maintained by few members). And it is "Python 3 ready" !

Categories