Last active
July 10, 2017 03:10
-
-
Save monokrome/5447258 to your computer and use it in GitHub Desktop.
Django template inheritance example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>{% block page_title %}{% endblock page_title %}</title> | |
</head> | |
<body> | |
{% block document_body %} | |
<div id=document-container>{% block document_container %}{% endblock document_container %}</div> | |
<footer id=document-footer>{% block document_footer %}{% endblock document_footer %}</footer> | |
{% endblock document_body %} | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block page_title %}Page Title{% endblock page_title %} | |
{% block document_footer %}Page Footer{% endblock document_footer %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base_site.html" %} | |
{% block document_container %} | |
<h1>Welcome to my site!</h1> | |
{% endblock document_container %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment