Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


it doesn't work I put in a file named templates it can find the file but it still doesn't work? thanks


<!doctype html>
<title> hello world </title>
<h1>{{ num1 }}+{{ num2 }} = {{num1 + num2}} </h1>


heres is shoplist.py

from flask import Flask
from flask import render_template

app = Flask(__name__)

def index(name="rodney"):
    return "hello from {}".format(name)

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


excuse the indentation I got that part right

[MOD: added ```python formatting -cf]

Chris Freeman
Chris Freeman
Treehouse Moderator 68,423 Points

Verifying you have files set up as:


Can you explain what isn't working? What are you trying and what is the result?

1 Answer

From the Flask Docs' Quickstart:

Flask will look for templates in the templates folder. So if your application is a module, this folder is next to that module, if it’s a package it’s actually inside your package:

Case 1: a module:


Case 2: a package: