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 an开发者_高级运维d all other pages will use that. How can I do this? I am a beginner in python
If you're using Django (or at least Django templates), Django template inheritance may be what you're looking for.
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
精彩评论