TECH I.S. テックアイエスガイド エディター
template.html
views.py
mymenu.html
<!DOCTYPE html> <html> <body> {% include "mymenu.html" with me="TOBIAS" sponsor="W3SCHOOLS" %} <h1>Welcome</h1> <p>This is my web site.</p> <p>Check out mymenu.html to see the HTML content of the include.</p> </body> </html>
from django.http import HttpResponse from django.template import loader def testing(request): template = loader.get_template('template.html') return HttpResponse(template.render())
<div>HOME | {{ me }} | ABOUT | FORUM | {{ sponsor }}</div>
127.0.0.1:8000/testing
Try It | Online Web Tutorials