Changeset - cf5b073d44b0
[Not reviewed]
0 2 0
Brett Smith (brett) - 7 years ago 2016-12-06 02:43:51
brett@sfconservancy.org
urls: Route /error/NNN/ to static.views.handler.

Since our Apache configuration uses `ErrorDocument NNN /error/NNN/`,
this is necessary to return the correct status code in those cases.
2 files changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/views.py
Show inline comments
...
 
@@ -16,3 +16,3 @@ def handler(request, errorcode):
 
    context = RequestContext(request)
 
    return HttpResponse(template.render(context), status=errorcode)
 
    return HttpResponse(template.render(context), status=int(errorcode))
 

	
www/conservancy/urls.py
Show inline comments
...
 
@@ -52,2 +52,3 @@ urlpatterns = patterns('',
 
    # formerly static templated things... (dirs with templates)
 
    (r'^error/(40[134]|500)(?:/index\.html|/|)$', 'conservancy.static.views.handler'),
 
    (r'^error', 'conservancy.static.views.index'),
0 comments (0 inline, 0 general)