diff --git a/strawberry/django/views.py b/strawberry/django/views.py index 5a09e4b71d..93ac6401ee 100644 --- a/strawberry/django/views.py +++ b/strawberry/django/views.py @@ -17,7 +17,7 @@ from django.http.response import HttpResponse from django.template import RequestContext, Template from django.template.exceptions import TemplateDoesNotExist -from django.template.loader import render_to_string +from django.template.loader import get_template from django.template.response import TemplateResponse from django.utils.decorators import classonlymethod, method_decorator from django.views.decorators.csrf import csrf_exempt @@ -215,7 +215,7 @@ def dispatch( def render_graphql_ide(self, request: HttpRequest) -> HttpResponse: try: - template = Template(render_to_string("graphql/graphiql.html")) + template = get_template("graphql/graphiql.html").template except TemplateDoesNotExist: template = Template(self.graphql_ide_html) @@ -274,7 +274,7 @@ async def dispatch( # pyright: ignore async def render_graphql_ide(self, request: HttpRequest) -> HttpResponse: try: - template = Template(render_to_string("graphql/graphiql.html")) + template = get_template("graphql/graphiql.html").template except TemplateDoesNotExist: template = Template(self.graphql_ide_html)