Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the error views. #315

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davidlesieur
Copy link

@davidlesieur davidlesieur commented Jun 30, 2024

The django-jinja documentation indicates the view that is provided to use with Django's handler500 is broken since Django 2.2.

The reason is that Django's 40x error views are expected to receive an exception positional argument, while the 500 view doesn't take that argument.

Since all we need from the django-jinja error views is to specify the template name, I didn't see the value of implementing custom class-based views, especially now that the 500 view is different from the others. Thus, I have also simplified the code to reuse Django's default error views.

Fixes #234.

@davidlesieur davidlesieur changed the title Update the error views. Fixes #234. Update the error views. Jun 30, 2024
@auvipy auvipy self-requested a review July 31, 2024 05:25
Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to be a breaking change. so I don't think we should follow this approach

@davidlesieur
Copy link
Author

Yes, it is a breaking change, but the 500 view has been broken since 2019 (Django 2.2). That no one has proposed a fix since then seems to indicate that few people have been using the error views. For those who are using them, the code change required for an upgrade is easy to apply. Moreover, the fix could be included in a major release to highlight the fact that the new version contains breaking changes.

@auvipy
Copy link
Collaborator

auvipy commented Aug 1, 2024

we need a gracefully way to upgrade / fix this

@davidlesieur
Copy link
Author

Perhaps the old views (except the 500 view) could be left there for a release or two, with a deprecation warning? But I think the old 500 view could be removed immediately since it doesn't work at all (as reported in #234).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Django 2.2.3, custom handler500 broken
2 participants