MasterPage like concept in python
Asked Answered
R

1

7

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

Resistive answered 8/1, 2010 at 4:46 Comment(0)
E
1

I think you are exactly looking for "template extending".

  1. Create base/master html file in "templates" folder.

    This will be base/master file where all theme css,js , html layout tags exists.

  2. Add place holders for child html "content" in above base/master html

    {% block content %} {% endblock %}

  3. 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

Emphatic answered 26/3, 2016 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.