2011-01-20 04:47:47 +00:00
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.shortcuts import get_object_or_404
|
2013-11-04 15:50:14 +00:00
|
|
|
from django.template import loader, Context
|
2011-10-13 21:34:56 +00:00
|
|
|
|
|
|
|
from .models import Person
|
|
|
|
|
2011-01-20 04:47:47 +00:00
|
|
|
|
|
|
|
def get_person(request, pk):
|
|
|
|
person = get_object_or_404(Person, pk=pk)
|
2013-07-29 17:19:04 +00:00
|
|
|
return HttpResponse(person.name)
|
2013-11-04 15:50:14 +00:00
|
|
|
|
2013-11-08 17:03:59 +00:00
|
|
|
|
2013-11-04 15:50:14 +00:00
|
|
|
def no_template_used(request):
|
|
|
|
template = loader.get_template_from_string("This is a string-based template")
|
|
|
|
return HttpResponse(template.render(Context({})))
|