Flask is a light weight web application backend Python framework.
Need basic knowledge of python.
It is easy to learn and maintain complex application easily.
It is one of the best python framework.
It have 52.3k stars on github,which is an achievement in itself.
source:https://flask.palletsprojects.com/en/1.1.x/
How to install flask
Step 1) first we have to make a virtual environment.It helps in avoiding conflict between packages and save all packages that are used in this app
a) To install virtual environment
pip(it is a package installer for python)
pip install virtualenv
b)Create virtual environment
Type command
virtualenv env (env => Name of virtual environment)
b) To activate virtual environment type command in terminal
python -m venv env
it will create a virtual(seperate) environment for our project.
Step 2) Now after this we have to install flask
now go to terminal type command
pip install flask
Step3) After installing flask create basic app
from flask import Flask,request (we are importing library from flask)
app=Flask(__name__) (initializing a flask app)
@app.route('/')
def hello()
return "Hello !"
To run a flask app in localhost we have to use a command in terminal
set FLASK_APP=app.py
after that run another command
flask run
Now in browser type command
localhost:5000
it will give a hello World page
we are ready with basics of flask to make a web app
Thanks for reading.
congratulations , your post has been upvoted manually by @tomoyan and @kamranrkploy.
Continue to contribute here and earn more.
Thanks