Getting Started with Flask
What is Flask?
Flask is a MicroFramework for Python based on Werkzeug, Jinja 2 and good intentions.
What does it come with?
- Built in development server and debugger
- Integrated unit testing support
- RESTful request dispatching
- Uses Jinja2 templating
- Support for secure cookies (client side sessions)
- 100% WSGI 1.0 compliant
- Unicode based
- Extensively documented
Installation
Make sure you have a working Python Installation.
We will be installing Flask in a VirtualEnv(Virtual Environment) to make sure there is no conflict of dependency versions.
On Mac OSX and Linux Systems the following commands should be enough to get you up and running with virtualenv.
OR
Otherwise please follow these instructions to install Pip
Now to create a VirtualEnv
Now, whenever you want to work on a project, you only have to activate the corresponding environment. On OS X and Linux, do the following:
On Windows:
And now you should finally be able to:
Runnning your first Flask App
Now open localhost:5000 to see the magic.