Changeset - ce1e8dd6d710
[Not reviewed]
0 1 1
Christopher Neugebauer - 3 years ago 2017-08-17 16:20:33
chrisjrn@gmail.com
Makes 500 errors accept a RequestContext
2 files changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
pinaxcon/urls.py
Show inline comments
...
 
@@ -5,9 +5,10 @@ from django.contrib.staticfiles.templatetags.staticfiles import static as _stati
 
from django.views.generic import TemplateView
 
from django.views.generic import RedirectView
 

	
 

	
 
from django.contrib import admin
 

	
 
from pinaxcon import views
 

	
 
import symposion.views
 

	
 

	
...
 
@@ -78,3 +79,5 @@ urlpatterns = [
 
]
 

	
 
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
 

	
 
handler500 = views.server_error
pinaxcon/views.py
Show inline comments
 
new file 100644
 
from django.http import HttpResponseServerError
 
from django.template import RequestContext
 
from django.template import Template
 
from django.template.loader import get_template
 
from django.views import defaults
 

	
 
def server_error(request, template_name=defaults.ERROR_500_TEMPLATE_NAME):
 
    t = Template("{%% include '%s' %%}" % template_name)
 
    return HttpResponseServerError(t.render(RequestContext(request)))
0 comments (0 inline, 0 general)