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

Andy Hughes
Andy Hughes
8,113 Points

Don't forget {% block content %}{% endblock %} for layout

In the video "add some layout", Kenneth shows you a pre-built layout.html file which he then starts adding authentication code to.

However, if you decide to build your own layout template file, you need to remember to add the {% block content %} <your content goes here> {% endblock %}. Otherwise, like me, you end up scratching your head for a good while trying to understand why (when you copied what Kenneth is doing), your links on your homepage no longer redirect to your register/login templates.

I know this has been covered before in way back videos, but this threw me.

In the video, this content block is already added and Kenneth doesn't explain that. So just be aware. :)

1 Answer