1 from django.template import Context, loader
3 from maintenancemode import http
5 def temporary_unavailable(request, template_name='503.html'):
7 Default 503 handler, which looks for the requested URL in the redirects
8 table, redirects if found, and displays 404 page if not redirected.
13 The path of the requested URL (e.g., '/app/pages/bad_page/')
15 t = loader.get_template(template_name) # You need to create a 503.html template.
16 return http.HttpResponseTemporaryUnavailable(t.render(Context({})))