background preloader

Flask (python)

Facebook Twitter

(2) Should I learn Flask or Django. Rxl/flask-app-generator. Lightweight Python Apps with Flask, Bootstrap, and Heroku. Welcome!

Lightweight Python Apps with Flask, Bootstrap, and Heroku

This is a quick start guide for easily and quickly deploying python apps. The goal of this guide is to provide you with a simple, step-by-step flow that you can follow when building small, simple apps from the ground up (which can later turn into large, complex apps). Each technology, including Heroku, Flask, and Twitter Bootstrap, has been carefully chosen to make the process as simple, quick, and painless as possible. Please note that this guide does not explain every step in detail, and assumes you have at some point interacted with either a few of these technologies or related ones.

For absolute beginners, I would recommend first heading over to the respective sites for flask and flask on heroku to get a little more acquianted. Now for a little introduction about the design decisions made in this quick start guide: Tutorial — Flask 0.10.1 documentation. Quickstart — Flask 0.10.1 documentation. Eager to get started?

Quickstart — Flask 0.10.1 documentation

This page gives a good introduction to Flask. It assumes you already have Flask installed. If you do not, head over to the Installation section. A Minimal Application A minimal Flask application looks something like this: from flask import Flaskapp = Flask(__name__) @app.route('/')def hello_world(): return 'Hello World!

' Just save it as hello.py (or something similar) and run it with your Python interpreter. . $ python hello.py * Running on Now head over to and you should see your hello world greeting. So what did that code do? Developing with Bottle - part 1. I love bottle.

Developing with Bottle - part 1

It's a simple, yet fast and powerful Python micro-framework, perfect for small web applications and rapid prototyping. It's also a perfect learning tool for those just getting starting with web development. Let's look at a quick example. This tutorial assumes you are running a Unix-based environment - e.g, Mac OSX, straight Linux, or Linux VM through Windows. I will also be using Sublime 2 as my text editor. Starting up First, let's create a directory to work in: $ mkdir bottle $ cd bottle. Developing with Bottle - part 2 (plot.ly API) Updated on 02/27/2014!

Developing with Bottle - part 2 (plot.ly API)

In this next post in the Developing with Bottle series, we'll be looking at both GET and POST requests as well as HTML forms. I'll also show you how to consume data from the plot.ly API. You'll also get to see how to create a cool graph showing the results of a cohort analysis study. (Click here if you are unfamiliar with cohort analysis.) Did you miss the first part? Basic Setup. Flask (web framework) Flask is called a microframework because it keeps the core simple but extensible.

Flask (web framework)

There is no database abstraction layer, form validation, or any other components where third-party libraries already exist to provide common functionality. However, Flask supports extensions, which can add such functionality into an application as if it was implemented in Flask itself. There are extensions for object-relational mappers, form validation, upload handling, various open authentication technologies, and more. Flask was created by Armin Ronacher. "It came out of an April Fool's joke but proved popular enough to make into a serious application in its own right The following code shows a simple web application that prints "Hello World! " Python Web Applications With Flask - Part I. Please note: This is a collaboration piece between Michael Herman, from Real Python, and Sean Vieira, a Python developer from De Deo Designs.

Python Web Applications With Flask - Part I

Articles in this series: Updated: November 17th, 2013 Recently, thanks to an awesome gig, I re-introduced myself to Flask, which is “a microframework for Python”. It is a great little framework; unfortunately, like Sinatra (which inspired it), making the transition from small “self-contained” applications to larger applications is difficult. There are a number of boilerplates out there (including my own Flask-Boilerplate) to help make the transition easier. After reviewing the available tutorials out there I thought, “there must be a better way” – then I saw Miguel Grinberg’s mega-tutorial. What we are building This series will be following the development of a web analytics solution called Flask-Tracking. At the end of the day, our goal (over and above having a working application that conforms to the above napkin spec) is to: Starting off and forms: Python Web Applications With Flask - Part II. Please note: This is a collaboration piece between Michael Herman, from Real Python, and Sean Vieira, a Python developer from De Deo Designs.

Python Web Applications With Flask - Part II

Articles in this series: Welcome back to the Flask-Tracking development series! For those of you who are just joining us, we are implementing a web analytics application that conforms to this napkin specification. For all those of you following along at home, you may check out today’s code with: or you may download it from the releases page on Github. Housekeeping To quickly review, in our last article we set up a bare-bones application which enabled sites to be added and visits recorded against them via a simple web interface or over HTTP. Today we will add users, access control, and enable users to add visits from their own websites using tracking beacons. From single to multi-package. When last we left our application, the directory structure looked something like this: Then there is the database setup in tracking.models. Users Enlisting help Models. Flask (A Python Microframework)