Flask Programming

Hands On No. 1 : Simple Flask Application

Resources

Source Code of hello.py
from flask import Flask
from flask import render_template
from flask import request

app = Flask(__name__, template_folder='templates')

@app.route("/")
def hello():
     return render_template('index.html')

@app.route("/index.html")
def hello1():
     return render_template('index.html')

@app.route("/aboutus")
def aboutus():
    return render_template('aboutus.html')

@app.route("/contactus")
def contactus():
    return render_template('contactus.html')

Source Code of index.html
Welcome to Home Page

Source Code of aboutus.html
Welcome to About Us Page

Source Code of contactus.html
Welcome to Contact Us Page