基本render()を使う。
from django.http import HttpResponse from django.template import loader def test_function(request): # 何かの処理 result = ## # html読み込み template = loader.get_template('somewhere/index.html') context = {'result': result} return HttpResponse(template.render(context, request))
from django.shortcuts import render def test_function(request): # 何かの処理 result = ## context = {'result': result} return render(request, 'somewhere/index.html', context)