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 Build a Social Network with Flask Broadcasting Add Some Layout

Chen Wang
Chen Wang
7,371 Points

How to debug in flask??

I tried to put the layout.html file in my local environment. I almost follow each step in the video. Just when I add the layout, it can't work.

Here is the error message I see when I try to visit the page: https://gist.github.com/anonymous/ee142e5ee8294b606b84

Actually, can anyone tell me how to debug using this example. I'm new in python web development. When there is a bug, I don't know how to figure it out.

Thanks!

1 Answer

Hubert M
Hubert M
9,633 Points

Hello,

You propably don't wait for answer anymore, but I had same issue. Error was due to this line in layout.html:

{{ url_for('stream', username=current_user.username) }}

stream does not exist in app.py at this point. I've commented <nav> tag and everything worked fine.

Best regards