Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Flask Basics Templates and Static Files Flat HTML

Christopher Stuart
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Stuart
Full Stack JavaScript Techdegree Graduate 27,771 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")


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?