top of page

Setting Up Flask First App

Updated: Mar 18, 2021

Introduction to Python Flask

Flask is a Python framework for creating web applications.

You can build following websites with Flask:

Blog Applications, Chat Applications, Data Visualisation, Dashboards, REST Applications, Admin Pages, Email-Services.


Setting Up Flask


Installing Flask To install flask all you need to do is just run this single command on your command prompt if you are using windows, terminal if you are using MacOS or Linux
Setting Up Flask First App

Installing Flask


To install flask all you need to do is just run this single command on your command prompt if you are using windows, terminal if you are using MacOS or Linux

Setting up Flask is pretty simple and quick. With pip package manager, all we need to do is: 

pip install flask


Once you're done with installing Flask, create a folder called FlaskApp. Navigate to the FlaskApp folder and create a file called app.py.


Import the flask module and create an app using Flask as shown:


from flask import Flask

app = Flask(__name__)


Now define the basic route / and its corresponding request handler:


@app.route("/")

def main():

return "Welcome!"


Next, check if the executed file is the main program and run the app:


if __name__ == "__main__":

app.run()


Save the changes and execute app.py:

python app.py


Point your browser to http://localhost:5000/ and you should have the welcome message.


If you like Codersarts blog and looking for Assignment help,Project help, Programming tutors help and suggestion you can send mail at contact@codersarts.com.

Please write your suggestion in comment section below if you find anything incorrect in this blog post.


bottom of page