0% found this document useful (0 votes)
135 views3 pages

Flask Notes Introduction

Uploaded by

odiwuorian55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views3 pages

Flask Notes Introduction

Uploaded by

odiwuorian55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Flask Module

Flask module provides the basic and advanced concepts of the


Python Flask framework. Our Flask module is designed for
beginners and professionals.
Flask is a web framework that provides libraries to build lightweight
web applications in python.

What is Flask?
Flask is a web framework that provides libraries to build lightweight
web applications in python. Flask is considered as a web
framework.

Prerequisite
Before learning Flask, you must have the basic knowledge of Python concepts, HTML/CSS
If you are not familiar with Python check [Link]
And HTML [Link]
CSS [Link]
First Flask application
In this section of the tutorial, we will build our first python website built using the Flask framework.
In this process, open any text editor of your choice as we are using the sublime text editor in this
tutorial.
Write the following lines of code and save to a file named as [Link].
from flask import Flask

app = Flask(__name__)

@[Link]('/home') # decorator defines a route


def home(): # each route has a function … recall def
return 'Our first Flask website'

if __name__ == '__main__':
[Link](debug=True)

Run the application, you get below on the python console,


* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on [Link] (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 959-517-385

Open your browser and access this link [Link]


There you go with your first flask application.

You might also like