We are developing a web based application in python on google app engine platform. I have different pages in web site. What I want is to have a master page like functionality like we have in asp.net where I have just on template and all other pages will use that. How can I do this? I am a beginner in python
MasterPage like concept in python
Asked Answered
I think you are exactly looking for "template extending".
Create base/master html file in "templates" folder.
This will be base/master file where all theme css,js , html layout tags exists.
Add place holders for child html "content" in above base/master html
{% block content %} {% endblock %}
Add following code line in "child" template to use above base/master html
{% extends 'path_to_base_html/base.html' %} {% block content %} Child html {% endblock %}
Thanks to this nice tutorial, http://tutorial.djangogirls.org/en/template_extending/index.html
© 2022 - 2024 — McMap. All rights reserved.