📖
Advanced Python
  • AdvancedPython.net
  • Day 1
    • Introduction
    • Activity 1
  • Day 2
    • Introduction
    • Activity 2
  • Day 3
    • Introduction
    • Activity 3
  • Day 4
    • Introduction
    • Activity 4
  • Day 5
    • Introduction
    • Activity 5
  • Day 6
    • Introduction
    • Activity 6
  • Day 7
    • Introduction
    • Activity 7
  • Day 8
    • Introduction
    • Activity 8
  • Day 9
    • Introduction
    • Final Project
  • Day 10
    • Introduction
Powered by GitBook
On this page
  • Video Presentation
  • Starter Code - index.html
  • Starter Code - hello.html
  • Starter Code - application.py

Was this helpful?

  1. Day 5

Activity 5

PreviousIntroductionNextIntroduction

Last updated 4 years ago

Was this helpful?

Video Presentation

Starter Code - index.html

<!DOCTYPE html>
<html>
    <head>
        <title>hello, world!</title>
    </head>
    <body>
        Welcome to Activity 5!
        <P>
        Try my new flask route: <a href="/hello">hello!</A>
    </body>
</html>

Starter Code - hello.html

<!DOCTYPE html>
<html>
    <head>
        <title>hello, world!</title>
    </head>
    <body>
        hello new page!
    </body>
</html>

Starter Code - application.py

from flask import Flask, render_template
app = Flask(__name__)

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