Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 18 lines (16 sloc) 0.529 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
"""Views for the Zinnia Demo"""
from django.conf import settings
from django.template import loader
from django.template import Context
from django.http import HttpResponseServerError


def server_error(request, template_name='500.html'):
    """
500 error handler.
Templates: `500.html`
Context:
STATIC_URL
Path of static media (e.g. "media.example.org")
"""
    t = loader.get_template(template_name)
    return HttpResponseServerError(
        t.render(Context({'STATIC_URL': settings.STATIC_URL})))
Something went wrong with that request. Please try again.