2011-01-20 04:47:47 +00:00
|
|
|
from django.http import HttpResponse
|
|
|
|
from django.shortcuts import get_object_or_404
|
2014-10-31 10:38:53 +00:00
|
|
|
from django.template import Context, Template
|
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):
|
2014-10-31 10:38:53 +00:00
|
|
|
template = Template("This is a string-based template")
|
2013-11-04 15:50:14 +00:00
|
|
|
return HttpResponse(template.render(Context({})))
|
2014-05-04 14:29:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
def empty_response(request):
|
|
|
|
return HttpResponse('')
|