📖
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
  • Presentation
  • Presentation Video
  • Starter Code - index.html
  • Starter Code - application.py
  • Starter Code - schedule.html
  • Bootstrap CSS

Was this helpful?

  1. Day 6

Activity 6

PreviousIntroductionNextIntroduction

Last updated 4 years ago

Was this helpful?

Presentation

Presentation Video

Starter Code - index.html

<!DOCTYPE html>
<html>
    <head>
        <title>Welcome to Activity 6</title>
    </head>
    <body>
        Welcome to Activity 6!
        <P>
        <h1>My Webpages</h1>
        <li><a href="/schedule">Schedule</a>
        <h1>My Favorite Websites</h1>
        <ol>
        <li><a href="https://www.trschools.com">Toms River Schools</A>
        <li><a href="https://tomsrivertownship.com/">Township of Toms River</A>
        </ol>
    </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("/schedule")
def schedule():
    return render_template('schedule.html')

Starter Code - schedule.html

<!DOCTYPE html>
<html>
    <head>
        <title>My Schedule</title>
    </head>
    <body>
        <h1>My Schedule</h1>
        <table>
            <tr>
                <th>Period</th><th>Class<th>
                <td>1</td><td>Computer Science</td>
                <td>2</td><td> </td>
            </tr>
        </table>
    </body>
</html>

Bootstrap CSS

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">