This tutorial will help you install Python and Flask. Even though we are using a Django Stack installer, Flask installation will not be affected. The reason we are using a stack installer is to get you up and running in a breeze without the overhead of solving operating system compatibility issues.
1. Install BitNami
Step 1. Go to https://bitnami.com and download Django Stack
Django and (at least) one Database

We would suggest you to install it under your home folder, so type ~/pythonstack for the folder path

You can just leave it blank right now.

[Caution] The installation might take around 20 mins

$ cd ~/pythonstack
$ ./use_djangostack
and you will see something like this shows up
bash-3.2$
$ easy_install pip
$ pip install --upgrade pip
You would need to enter your computer's password here
$ sudo pip install Flask
Make sure you are inside the BitNami Environment, create a test folder and go into the folder
$ mkdir test
$ cd test
$ open .
Use your text editor (ex. Atom, Sublime, Vim ...) to create the hello world example. Save it under the test folder we just created.
[Important] Indentation is very important in Python. Code without correct indentation might not work.
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
Save the file and make sure it is in the test folder we just created. In the terminal, type:
$ python app.py
You will see something like to indicate your server is running correctly.
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
In your browser's address line, type 127.0.0.1:5000 or localhost:5000, and you should be able to see something like this.


