2010-01-10 17:35:01 +00:00
|
|
|
from django import http
|
2010-10-30 07:19:04 +00:00
|
|
|
from django.core.exceptions import PermissionDenied
|
2010-12-07 13:57:01 +00:00
|
|
|
from django.template import Template
|
|
|
|
from django.template.response import TemplateResponse
|
|
|
|
|
2010-01-10 17:35:01 +00:00
|
|
|
|
2010-10-30 07:19:04 +00:00
|
|
|
def normal_view(request):
|
|
|
|
return http.HttpResponse('OK')
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2010-12-07 13:57:01 +00:00
|
|
|
def template_response(request):
|
|
|
|
return TemplateResponse(request, Template('OK'))
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2010-12-07 13:57:01 +00:00
|
|
|
def template_response_error(request):
|
|
|
|
return TemplateResponse(request, Template('{%'))
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2010-10-30 07:19:04 +00:00
|
|
|
def not_found(request):
|
|
|
|
raise http.Http404()
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2010-10-30 07:19:04 +00:00
|
|
|
def server_error(request):
|
|
|
|
raise Exception('Error in view')
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2010-10-30 07:19:04 +00:00
|
|
|
def null_view(request):
|
|
|
|
return None
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2010-10-30 07:19:04 +00:00
|
|
|
def permission_denied(request):
|
|
|
|
raise PermissionDenied()
|