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 trialTafadzwa Timothy Gakaka
10,978 PointsFlask Basics
Attach the following view to my app with the route of /teachers.
def teachers(): return 'We have lots of teachers!'
im stuck anyone?
2 Answers
Mel Rumsey
Treehouse ModeratorAdding a route above a function requires a decorator of @app.route
then inside the parenthesis you need to specify what the route is in the parenthesis.
For example:
@app.route('/')
def index():
return "This is my home page!"
I suggest reviewing this video :) First Steps
Tyler Duvall
Python Development Techdegree Graduate 11,791 Pointsflasking can be tough and the is a lot you have to pay attention too. this code here is what it should look like. Happy coding!
@app.route('/teachers')
def teachers():
return "We have lots of teachers"