TECH I.S. テックアイエスガイド エディター
template.html
views.py
from django.http import HttpResponse from django.template import loader from .models import Member def testing(request): mydata = Member.objects.all().order_by('lastname', '-id').values() template = loader.get_template('template.html') context = { 'mymembers': mydata, } return HttpResponse(template.render(context, request)) # Check out template.html to see how the mymembers object # was used in the HTML code.
127.0.0.1:8000/testing
Try It | Online Web Tutorials