Python web development with Flask(introduction)
- winstonmhango23
- Jan 24, 2021
- 3 min read
Updated: Jan 27, 2021

FLASK is a microframework for developing web applications using the Python programming language. It uses the JINJA templating engine and workzeug toolkit for creating and rendering web templates and creating HTTP requests and responses to server requests. In this series of Python web development with flask, we will be discussing and creating several web applications while taking a real-world implementation and application of the Python programming skills.
TOPIC LIST
Why Flask
A look at the Flask application
Python and Flask
What Next
1.WHY FLASK
Developing apps in Flask has a much different narrative than when developing in more traditional MVC Frameworks like Django. Many frameworks easily take hours to set up and get to the development process: with the assumption that our app needs all the bells and whistles, it is almost impossible to get a “Hello world!” off the ground without a full understanding of database configurations, static assets, templates, and other things our app may sometimes not even need. Asking data analysts (who have mostly become accustomed to Jupyter notebooks) to pick up all the fundamentals of web development before even getting started is just unrealistic.
Flask, although deemed and looked at as a microframework, is the most viable answer to this over repeated bunch feed to the unnecessary patterns. It has a very small footprint that takes almost just a few hours for one beginner to set up and run a web application. In fact, you can build any size of a web application with a flask framework.
Web development.One drop at atime

Just as stated in its motto, web development, one drop at a time. You don't need to learn and understand everything there is to develop a web application in Flask. But eventually, as your application demands, you pick up on more advanced and necessary aspects of the framework.
2. A LOOK AT THE FLASK APPLICATION
It takes only 7 lines of Python code to be up and running in a flask application.
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
Yes, I like the flask framework. It's actually a framework that I see as being closest to writing pure python code. What you see in the script above can be summarised in the following order.
line 1 imports the Flask class from the python module named flask
line 2 we create the instance of the class Flask, assigning it to a variable app.
line 3 takes care of assigning a view function name hello() to an endpoint on our server. In Flask, we use the route decorator provided by the Flask instance to associate a URL to a view function.
Each time we point our web browser root of our web server, the route(/) will call the hello() view function which returns just a "Hello World " string to the browser.
That's all there is to it to get up and running in Flask!! I know you have got plenty of questions. Don't worry, we will address them all as we progress in the series.
3. PYTHON AND FLASK
Flask is the easiest way to appretiate your python skills on the web. As you will see, it is easy to turn any of your Python console scripts into a web-based application with ease in Flask. But I must state here that just learning a few python basics won't help you get anywhere with either flask or any of the web frameworks. All you will be doing is copying and pasting code that you won't even understand.
Luckily, right on this blog, we will be running a series on python programming concepts too. So make good use of it to advance your skills.
4. WHAT NEXT?
In our next post, we will get our hands dirty, going practical with preparing the flask development environment, installing the required packages, and laying out our first flask project.
Short and precise