mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Avoided using private API get_template_from_string.
This commit is contained in:
parent
f2ddc439b1
commit
c0c1bb9e64
4 changed files with 12 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
from django.http import HttpResponse
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.template import loader, Context
|
||||
from django.template import Context, Template
|
||||
|
||||
from .models import Person
|
||||
|
||||
|
@ -11,7 +11,7 @@ def get_person(request, pk):
|
|||
|
||||
|
||||
def no_template_used(request):
|
||||
template = loader.get_template_from_string("This is a string-based template")
|
||||
template = Template("This is a string-based template")
|
||||
return HttpResponse(template.render(Context({})))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue