Tag archives for: flask

Thoughts on Modularizing Flask Applications

I've been playing around with the Flask web framework for a while now. It's the basis for YAWT, the CMS/blogging system I'm currently developing (mostly as an exercise in familiarizing myself with Python)

With Flask, it's dead simple to get a very basic web application up and running:

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

@app.route("/blah")
def blah():
    return "Hello Blah!"

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

Put this in a python file called blah.py, mark it as executable, and run it. You should be able to access the web application on locahost:5000. It does not, admittedly, do anything even remotely interesting, but it's enough to get the basic idea.

Read more