Flask is a micro web framework written in Python. It is classified as a micro-framework because it does not require particular tools or libraries. Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.
Installation:
1) In order to create the flask app we have to first install the flask.
pip install flask
2) In order to extract the data from Wikipedia, we must first install the Python Wikipedia library.
pip install wikipedia
Createaflask app:
3) Create a file and name it as app.py
4) Create the templates folder to store all the html files.
Folder structure:

How to create wikipedia search app using Flask Framework?
Now, let's start coding the application
Create the file -app.py
Python3# import necessary librariesfromflaskimportFlask,request,render_templateimportwikipediaapp=Flask(__name__)# create HOME View@app.route("/",methods=["POST","GET"])defhome():ifrequest.method=="GET":returnrender_template("index.html")else:search=request.form["search"]# Fetch data from wikipediaresult=wikipedia.summary(search,sentences=2)returnf"<h1>{result}</h1>"if__name__=='__main__':app.run(debug=True)Create a fileindex.html that will be used by flask -
HTML<!DOCTYPE html><html><head><title>Wikipedia Search</title></head><body><formmethod="post"><inputtype="text"name="search"><br><buttontype="submit">Search</button></form></body></html>
Output:

If we search INDIA in this input tag then the output is:

Explore
Python Fundamentals
Python Data Structures
Advanced Python
Data Science with Python
Web Development with Python
Python Practice