cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Change DEBUG=True error views into custom views

Open Andrew-Chen-Wang opened this issue 3 years ago • 0 comments

https://github.com/pydanny/cookiecutter-django/blob/4f631e148388d12d95ef567dcb56d529fee26c63/%7B%7Bcookiecutter.project_slug%7D%7D/config/urls.py#L44-L61

Rather than having to go to individual URLs to view our custom code, which could raise something like PermissionDenied(mark_safe(_("<strong></strong>"))), it should automatically show these custom error messages.

Ref:

  • https://docs.djangoproject.com/en/3.1/ref/views/#error-views
  • https://docs.djangoproject.com/en/3.1/topics/http/views/#customizing-error-views

Rationale

For me, I'm just seeing a string of text for my errors. Not colorful and not helpful. The custom views serve the same purpose but they at least use extends base.html.

Andrew-Chen-Wang avatar Sep 11 '20 16:09 Andrew-Chen-Wang