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

Python Flask Basics Welcome to Flask Create a view

Can't get past this challenge

I don't get why I can't get past with:

from flask import Flask

app = Flask(__name__)


@app.route('/')
def index():
  return "Hello World"

app.run(debug=True, port=8000, host='0.0.0.0')

3 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Your code is correct and the CC passes if you leave off the app.run(). I'll add a note about that.

Thank you!

Thank you!

Shouldn't it be:

app = Flask(__name__)

Isn't it that already?

You don't need the app.run section for this test, I'm pretty sure its also looking for your name. It may technically be testing for your name rather than "Hello World"

PS. I'll assume the forum ate your underscores.

You can include code by using three back ticks (below esc key).

Ok, thanks!