News for hackers. Stuff that matters.
Re:I only know PHP. How do I write a Web application in Python? by Marwy on Sunday May 06, 2012 @04:27AM (#3934533)
I've seen Flask mentioned here few times. Is Flask better than Bottle?
Re:I only know PHP. How do I write a Web application in Python? by lclarkmichalek on Sunday May 06, 2012 @05:36AM (#3934645)
In my humble opinion.. Yes. I feel bottle sacrifices just a little too much for the sake of being a single file distribution. The lack of any (mainstream) templating engine might hinder newcomers, and Flask uses one of the best python templating engines around. I also find Flask's documentation to be more extensive and better laid out. Overall I would recommend Flask if you want to write a full featured website, Bottle if you are looking to write some kind of API layer, or similarly bear bones functionality, and will not require many "batteries included".
Re:I only know PHP. How do I write a Web application in Python? by Marwy on Sunday May 06, 2012 @08:47AM (#3934971)
You can use Jinja2 with Bottle:

> pip install Jinja2

from bottle import jinja2_template as template