Your First website with Flask

Nitish Kumar
Dec 26, 2020

--

Flask is one of the most popular web framework in Python.

Its is very east that you can deploy your website in fewer lines of code.

Install Flask in your system.

pip install flask

File structure is important.

In this tutorial we will learn how to write your flask web app.

=>Application folder
==>Hello.py
==>templates
====> hello.html

from flask import Flaskapp = Flask(__name__)@app.route(‘/’)
def index():
return render_template(‘hello.html’)

if __name__ == ‘__main__’:
app.run(debug = True)

and now make some simple html page

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Your first Flask Website</title></head><body><h1> Follow @nitish_leeo at Instagram </h1></body></html>

Thank you !!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Nitish Kumar
Nitish Kumar

Written by Nitish Kumar

Data engineer / Python / NodeJS

No responses yet