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

hector alvarado
hector alvarado
15,796 Points

What process the template??

I don't understand clearly the flow of the template. So you create a template and the render() function make the code readable for the browser right??

  1. So if change the argument of the render file on the function, I could render any html file??
  2. If If i want to render another website i've made, I would need to make it on a template?

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,166 Points

The render function formats the HTML to be sent as an HTTP response. This can be a HTML file directly, or it can be a template file in HTML format with placeholders that use context data from the render function to produce unique HTML. This flow is very flexible and can use any HTML / template combination.

Templates and HTML files are usually kept separately for each website, but nothing prevents using files from one website to create pages for another website.

Post back if you have further questions. Good luck!