Upgrade Django to versions 4.2.30, 5.2.13, and finally 6.0.4#65
Upgrade Django to versions 4.2.30, 5.2.13, and finally 6.0.4#65
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project for newer Django versions by updating core dependencies and aligning settings, templates, and form integrations (Bootstrap + reCAPTCHA), along with some dev workflow tweaks.
Changes:
- Upgrade Django and related dependencies; switch
bootstrap5→django_bootstrap5andcaptcha→django_recaptcha. - Update static files configuration to Django’s newer
STORAGESsetting (with WhiteNoise). - Adjust templates/tests/commands for new dependencies and timezone handling; minor Makefile workflow updates.
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| web/templates/login.html | Switch template tag load to django_bootstrap5 and adjust submit button markup. |
| web/templates/base.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| web/templates/about.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| web/forms.py | Switch ReCAPTCHA field import to django_recaptcha. |
| udlejning/tests.py | Replace pytz usage with stdlib datetime.timezone.utc. |
| udlejning/templates/udlejningTent.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| udlejning/templates/udlejningSpeakers.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| udlejning/templates/udlejningProjector.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| udlejning/templates/udlejningGrill.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| udlejning/templates/udlejningBoardGameCart.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| udlejning/templates/udlejning.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %} and update submit button markup. |
| udlejning/forms.py | Switch ReCAPTCHA field import to django_recaptcha. |
| requirements.txt | Regenerated lockfile with upgraded Django/deps; switches to django-bootstrap5, django-recaptcha, psycopg, etc. |
| requirements.in | Update top-level dependency constraints for the new Django/dependency baseline. |
| mail/models.py | Update CheckConstraint kwarg name. |
| mail/migrations/0006_forwardedmail_previous_attempt_integrity.py | Update CheckConstraint kwarg name in migration. |
| items/templates/items.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| items/management/commands/import_inventory.py | Switch datetime parsing/timezone handling to stdlib timezone/timedelta. |
| guides/templates/guides.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| gallery/tests.py | Adjust media test file creation to in-memory uploads; change MEDIA_ROOT override. |
| gallery/templates/image.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| gallery/templates/gallery.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| gallery/templates/album.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| fredagscafeen/settings/local.py | Update silenced system check to django_recaptcha identifier. |
| fredagscafeen/settings/htlm5.py | Move static storage configuration to STORAGES with WhiteNoise backend. |
| fredagscafeen/settings/base.py | Swap installed apps to django_bootstrap5/django_recaptcha; remove legacy bootstrap settings and old i18n/tz flags. |
| fredagscafeen/admin_view.py | Add is_composite_pk attribute on Meta shim for newer Django expectations. |
| events/templates/events.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| events/templates/event.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %} and update submit button markup. |
| events/templates/common-events.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| docker-compose.yml | Bump Postgres image major version. |
| bartenders/templates/index.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %} and update submit button markup. |
| bartenders/templates/board.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| bartenders/templates/bartender_info.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %} and update submit button markup. |
| bartenders/templates/barplan.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| bartenders/templates/ballots_update.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %} and update submit button markup. |
| bartenders/templates/ballots.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| bartenders/forms.py | Switch ReCAPTCHA field import to django_recaptcha. |
| bartenders/admin.py | Improve admin-user password generation using secrets. |
| bartab/templates/bartab.html | Replace {% load bootstrap5 %} with {% load django_bootstrap5 %}. |
| Makefile | Add collectstatic target; run collectstatic before run; rename download-media target. |
| .gitignore | Add ignore entry for temp media dir. |
| .dockerignore | Add ignore entry for temp media dir. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 49 out of 51 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…e MEDIA_ROOT in tests to use tempfile
…an up imports in tests
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 50 out of 51 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…oper timezone assignment
AndersSeverinsen
left a comment
There was a problem hiding this comment.
Det ser godt ud. Jeg håber ikke der kommer nogle seriøse fejl i PROD.
Check gerne mine små ændringer:
- Jeg prøvede at lave et nyt galleri album, men den gav en fejl og havde noget mærkelig CSS på admin siden, som jeg fiksede.
- Derudover, havde min docker desktop en warning med et LegacyKeyValueFormat.
- Unused import Copilot havde kommenteret.
|
Der skulle gerne være styr på det. Jeg fandt en fejl med et custom |
This pull request includes several important updates to dependencies and configuration, as well as code and template changes to support these updates. The main themes are migrating from
bootstrap5todjango_bootstrap5, switching the CAPTCHA integration fromcaptchatodjango_recaptcha, updating the PostgreSQL version in Docker, and improving static files handling. Additionally, there are minor improvements to password generation and form button markup.Dependency and Configuration Updates
bootstrap5todjango_bootstrap5throughout the project, updating all template{% load %}statements and the installed apps insettings/base.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]captchawithdjango_recaptchain both dependencies and imports, including updating form fields and silenced system checks. [1] [2] [3]docker-compose.yml.STORAGESsetting andwhitenoisefor static files.Template and UI Improvements
<div class="mt-3">wrapper instead of{% buttons %}for better styling and clarity. [1] [2] [3] [4] [5]bootstrap5configuration from settings.Build and Development Workflow
Makefileby adding acollectstaticcommand, ensuring static files are collected before running the server, and renameddownload-mediatoimport-mediafor clarity. [1] [2] [3].dockerignoreto exclude the/temp_media_tmpdirectory.Code Improvements
secrets.token_urlsafefor better security. [1] [2]Other Minor Changes
is_composite_pkto theMetaclass infredagscafeen/admin_view.py.settings/base.py.