Last active
September 16, 2015 17:22
-
-
Save klebercode/a45c94f8ced4a1f08d49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add 404.html and 500.html path root project | |
# urls.py | |
handler404 = 'app.core.views.handler404' | |
handler500 = 'app.core.views.handler500' | |
# views.py | |
from app.context_processors import enterprise_proc | |
def handler404(request): | |
response = render( | |
request, '404.html', {}, | |
context_instance=RequestContext(request, | |
processors=[enterprise_proc])) | |
response.status_code = 404 | |
return response | |
def handler500(request): | |
response = render( | |
request, '500.html', {}, | |
context_instance=RequestContext(request, | |
processors=[enterprise_proc])) | |
response.status_code = 500 | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment