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 to django 4.1 #1796

Closed
richardebeling opened this issue Aug 15, 2022 · 1 comment · Fixed by #1799
Closed

Update to django 4.1 #1796

richardebeling opened this issue Aug 15, 2022 · 1 comment · Fixed by #1799
Labels
[C] Backend Focuses on backend implementation

Comments

@richardebeling
Copy link
Member

richardebeling commented Aug 15, 2022

(#1794 is currently blocked by a bug that is fixed in django 4.1)

Same procedure as every year

Some points I think might be relevant

  • Django enables the cached template loader by default now. I think we want to be able to edit a template, reload the page, and instantly see the changes reflected with a development setup. So, we probably want to set a custom, non-cached template loader when DEBUG=True? Edit: As pointed out by @karyon below, the cached template loader has some auto-reload functionality, should work for us.
  • https://code.djangoproject.com/ticket/33631 was closed, so blocktranslate asvar now marks the output as safe. This should allow us to remove all |safe filter calls that we have left in our templates after Fix broken html escaping in various places #1737. Edit: This will be in 4.2, not 4.1
  • Django defaults to a new forms renderer using div tags. We should check if this breaks some layout because CSS rules do not apply anymore. Edit: As @karyon points out below, default will be changed in 5.0.
@richardebeling richardebeling added the [C] Backend Focuses on backend implementation label Aug 15, 2022
@niklasmohrin niklasmohrin changed the title Update to django 4.2 Update to django 4.1 Aug 15, 2022
@karyon
Copy link
Collaborator

karyon commented Aug 21, 2022

Regarding the first point, looking at https://code.djangoproject.com/ticket/33639, it seems that templates do auto-reload even when cached.
Regarding the third point, the default is changed only in 5.0.

Now that constraints are validated during model validation, this Questionnaire validation error can probably be expressed as a constraint. That would give us additional safety at the db level.

Somewhat related, I noticed a couple asserts/checks that might be better expressed as constraints. I'm not sure there was a reason why we didn't do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Backend Focuses on backend implementation
Development

Successfully merging a pull request may close this issue.

2 participants