PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/tests/regressiontests/middleware_exceptions/views.py

https://code.google.com/p/mango-py/
Python | 26 lines | 18 code | 8 blank | 0 comment | 0 complexity | 3f7d0f35baf9bc5eaac0a7157f0245b3 MD5 | raw file
 1from django import http
 2from django.core.exceptions import PermissionDenied
 3from django.template import Template
 4from django.template.response import TemplateResponse
 5
 6
 7def normal_view(request):
 8    return http.HttpResponse('OK')
 9
10def template_response(request):
11    return TemplateResponse(request, Template('OK'))
12
13def template_response_error(request):
14    return TemplateResponse(request, Template('{%'))
15
16def not_found(request):
17    raise http.Http404()
18
19def server_error(request):
20    raise Exception('Error in view')
21
22def null_view(request):
23    return None
24
25def permission_denied(request):
26    raise PermissionDenied()