Ignore compressed statics.
[redakcja.git] / apps / maintenancemode / views / defaults.py
1 from django.template import Context, loader
2
3 from maintenancemode import http
4
5 def temporary_unavailable(request, template_name='503.html'):
6     """
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.
9     
10     Templates: `503.html`
11     Context:
12         request_path
13             The path of the requested URL (e.g., '/app/pages/bad_page/')
14     """
15     t = loader.get_template(template_name) # You need to create a 503.html template.
16     return http.HttpResponseTemporaryUnavailable(t.render(Context({})))