From 77c6a12eaa9b5cc05cbc57f82e87a51047e484f4 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Wed, 16 Dec 2015 14:12:47 +0530 Subject: [PATCH] fix(urls): update 4xx error pages preview, to accept exceptions closes #444 --- CHANGELOG.md | 3 +++ {{cookiecutter.repo_name}}/config/urls.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dd80111..73318e76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All enhancements and patches to cookiecutter-django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2015-12-16] +- Update preview 4xx error pages to accept `exception` argument (@theskumar) + ## [2015-12-15] ### Changed - Fix celery worker app name in Procfile (@stepmr) diff --git a/{{cookiecutter.repo_name}}/config/urls.py b/{{cookiecutter.repo_name}}/config/urls.py index 8afe9c06..b63a9731 100644 --- a/{{cookiecutter.repo_name}}/config/urls.py +++ b/{{cookiecutter.repo_name}}/config/urls.py @@ -28,8 +28,8 @@ if settings.DEBUG: # This allows the error pages to be debugged during development, just visit # these url in browser to see how these error pages look like. urlpatterns += [ - url(r'^400/$', default_views.bad_request), - url(r'^403/$', default_views.permission_denied), - url(r'^404/$', default_views.page_not_found), + url(r'^400/$', default_views.bad_request, kwargs={'exception': Exception("Bad Request!")}), + url(r'^403/$', default_views.permission_denied, kwargs={'exception': Exception("Permissin Denied")}), + url(r'^404/$', default_views.page_not_found, kwargs={'exception': Exception("Page not Found")}), url(r'^500/$', default_views.server_error), ]