Python Flask Basics Templates and Static Files Flat HTML

Christopher Stuart
Christopher Stuart
Full Stack JavaScript Techdegree Graduate 27,736 Points

Can't pass add.html template

for some reason when i preview this it is still printing "Hello from Treehouse" and not passing the add.html template. Any help?

from flask import Flask
from flask import render_template

app = Flask(__name__)

def index(name="Treehouse"):
    return "Hello from {}".format(name)

def add(num1,num2):
    context = {'num1':num1, 'num2': num2}
    return render_template("add.html"),port=8000,host='')

Ryan Oakes
Ryan Oakes
9,787 Points

Are you actually changing your URL in the browser? They're two separate views, so you will need to go to something like "/add/3/4" to actually see the change.

If you are going to the new URL and it's not loading the view what error message are you getting?