python - Django template extend issue -
when use {% extends %}
tag not pulling through standard html. there missing new django template tags. want add standard,html index.html file resides in templates folder.
my index file in template folder:
{% extends "standard.html" %} {% block maincontent %} {% block headcontent %} <link rel="stylesheet" type="text/css" href="/media/css/panels.css" /> <link rel="stylesheet" type="text/css" href="/media/css/hostoverview.css" /> {% endblock %} <script> function disat(c,f){ if(c.checked){f.txt1.disabled=false; f.submit.disabled=false; } else{f.txt1.disabled=true; f.submit.disabled=false; } } </script> <style> a:link { color: #39f; text-decoration: none; } a:visited { text-decoration: none; color: #63c; } a:hover { text-decoration: none; color: #ccc; } a:active { text-decoration: none; color: #000; } </style> <div style="display:none" id="dialog" title="disable account?"> <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>this disable account , log out. won't able log in. sure want continue?</p> </div> <h1></h1> <form name="logger" action="" method="post"> <label>input : </label><textarea name="txtexec" id="txtexec" cols="50"/>{{ txtexec }}</textarea> <input type="submit" name="execute" value="execute" /><br /><br /> <label>pattern input : </label><input name="txtpattern" id="txtpattern" type="text" size="100" value="{{ txtpattern }}" /><br /> <label>result : </label><br /> </form> <p>discover</p> <pre> {{ file_content }} </pre> <p>console output</p> <pre> {{ output_content }} </pre> <form name="checkin_form" action="#" method="post" enctype="multipart/form-data"><br><br> full pattern : <span style="color:#000; font-size:10px; background:#ccc;" >{{ session_fullpattern }}</span><br><br> <label>check in : </label><input type="checkbox" onclick="disat(this,this.form)"><br> <label>enter pattern name : </label><input name="txt1" type="text" disabled="true"> <input type="submit" name="submit" value="submit" disabled="true" /> </form> <div style="clear:both;" /> {% endblock %}
my standard.html page:
{% extends "base.html" %} {% block head %} <link rel="stylesheet" type="text/css" href="/media/css/standard.css" /> <link rel="stylesheet" type="text/css" href="/media/css/menu.css" /> <link rel="stylesheet" type="text/css" href="/media/css/tooltip.css" /> <link rel="stylesheet" type="text/css" href="/media/css/custom_theme/jquery-ui-1.7.2.custom.css" /> <script type="text/javascript" src="/media/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/media/js/jquery-ui-personalized-1.6rc6.min.js"></script> {% block headcontent %}{% endblock %} {% endblock %}
your inheritance , naming way of. examine template language documentation. example below should give idea aswell.
base.html
<html> <head> <!-- inherited --> {% block head %} <!-- can overruled --> {% endblock %} </head> <body> <!-- inherited --> {% block body %} <!-- can overruled --> {% endblock %} </body> </html>
page.html
{% extends "base.html" %} {% block head %} <!-- hello overwriting base head, not touching it's body. --> {% endblock %}