Newbie: Python 3 and web applications?

Wayne Werner wayne at waynewerner.com
Tue Jul 30 23:14:13 CEST 2013


On Fri, 26 Jul 2013, Rui Maciel wrote:

> I'm currently learning Python, and I've been focusing on Python3.  To try to
> kill two birds with one stone, I would also like to learn the basics of
> writing small web applications.
>
> These web applications don't need to do much more than provide an interface
> to a small database, and they may not even be required to be accessible
> outside of a LAN.
>
> Does anyone have any tips on what's the best way to start off this
> adventure?

Take a look at the Python3 branch of Flask: 
https://github.com/mitsuhiko/flask.git

And the werkzeug webserver:
https://github.com/mitsuhiko/werkzeug.git


If you download these you can install them with:

> python setup.py install

(werkzeug first, then flask)


Here's the most basic webserver you can create that way:


from flask import Flask

app = Flask(__name__)

@app.route("/")
def main():
     return "Hello, Web!"

if __name__ == "__main__":
     app.run()



And yet flask is highly extensible with a lot of plugins.


HTH,
W



More information about the Python-list mailing list