Commit 0fab4cdd by Bridger Maxwell

Added a method to render 404 and 500 pages. Added a reference to these views in urls.py.

parent 75318164
......@@ -40,7 +40,12 @@ def render(request, template):
url(r'^jobs$', 'static_template_view.views.render', {'template': 'jobs.html'}, name="jobs")
"""
return render_to_response('static_templates/' + template, {})
def render_404(request):
return render_to_response('static_templates/404.html', {})
def render_500(request):
return render_to_response('static_templates/server-error.html', {})
valid_auth_templates=[]
......
<%inherit file="../main.html" />
<section class="outside-app">
......
<%inherit file="../main.html" />
<section class="outside-app">
<h1>There has been an error on the <em>edX</em> servers</h1>
<h1>There has been a 500 error on the <em>edX</em> servers</h1>
<p>Our staff is currently working to get the site back up as soon as possible. Please email us at <a href="mailto:technical@mitx.mit.edu">technical@mitx.mit.edu</a> to report any problems or downtime.</p>
</section>
......@@ -162,3 +162,9 @@ urlpatterns = patterns(*urlpatterns)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
#Custom error pages
handler404 = 'static_template_view.views.render_404'
handler500 = 'static_template_view.views.render_500'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment