
import logging
import sys

from django.conf import settings
from django.shortcuts import render

logger = logging.getLogger(__name__)

def server_error(request):
    response = None
    try:
        response = render(request, '500.html', {'base_url': settings.BASE_URL})
    except:
        import traceback
        logger.error("server_error %s : %s", sys.exc_info()[0], traceback.format_exc())
    response.status_code = 500
    return response