Alex Kehayias's Blog

  • Archive
  • RSS

This is why I love Flask

from flask import Flask
from flask import render_template, url_for
app = Flask(__name__)

@app.route('/')
def homepage():
    return render_template('index.html')

if __name__ == '__main__':
    app.run(debug=True)

url_for('static', filename='/stylesheets/compass_foundation.css')

Cool! This is a single page app using Flask. Oh and you can run a test server with “python <name_of_file>.py”. Don’t need no full-blown feature heavy framework, no stinkin ORM, no form handling, authentication, etc for this simple project. Somehow I feel cleaner using Flask… How much of Django am I actually utilizing? I’m beginning to see the light about python web microframeworks.

    • #flask
    • #python
    • #microframework
    • #django
  • 4 months ago
  • 14
  • Permalink
  • Share
    Tweet

14 Notes/ Hide

  1. yeseniauio09 liked this
  2. murphytii0 liked this
  3. womainkee liked this
  4. alexkehayias posted this
← Previous • Next →

About

Blogging about hacking code, life, and music.

Me, Elsewhere

  • @alexkehayias on Twitter
  • Facebook Profile
  • Linkedin Profile

Twitter

loading tweets…

I Dig These Posts

  • Photo via marksbirch

    Every so often in my web ramblings, I come across an interesting tidbit. While not meant to be an endorsement of Automattic, I find it interesting...

    Photo via marksbirch
  • Post via franciscohui
    Some thoughts on pacing your life

    We live with contradictions. Which are okay for the most part, except when we’re not aware of them. It is a source...

    Post via franciscohui
  • Photoset via lifeandcode

    hasablog:

    GitHub stickers! Awesome gift :]

    Photoset via lifeandcode
  • Photo via franciscohui

    skewed. (via Porca Miseria)

    Photo via franciscohui
See more →
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr