Skip to content

Commit 2751851

Browse files
committed
Upgrade to Django 5.2 LTS
1 parent 180cbf2 commit 2751851

9 files changed

Lines changed: 55 additions & 57 deletions

File tree

.github/workflows/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM python:3.10-alpine
1+
FROM python:3.13-trixie
22

33
WORKDIR /app
44

5-
RUN apk update && apk add git
5+
RUN apt update && apt install -y git gcc musl-dev libffi-dev
66

7-
RUN adduser --disabled-password prospector prospector \
7+
RUN adduser --disabled-password prospector \
88
&& chown -R prospector:prospector /app \
99
&& rm -rf ${HOME}/.cache/ ${HOME}/.local/bin/__pycache__/
1010
USER prospector

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ There is a Docker container image available for local testing and development of
1212
Requirements
1313
------------
1414

15-
* Python 3.8+
16-
* Django 4.2+
15+
* Python 3.10+
16+
* Django 5.2+
1717
* Postgresql 12+
1818

1919
More details of packages in installation documentation.

accounts/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.urls import re_path
1+
from django.urls import path
22
from django.contrib.auth import views as auth_views
33

44
import django_lti_login.views
@@ -7,7 +7,7 @@
77
urlpatterns = [
88
# Only some of the auth.urls are currently enable
99
#re_path('^', include('django.contrib.auth.urls')),
10-
re_path(r'^login/$', auth_views.LoginView.as_view(), name='login'),
11-
re_path(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
12-
re_path(r'^lti_login$', django_lti_login.views.lti_login, name='lti_login'),
10+
path('login/', auth_views.LoginView.as_view(), name='login'),
11+
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
12+
path('lti_login', django_lti_login.views.lti_login, name='lti_login'),
1313
]

core/urls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.conf import settings
2-
from django.urls import re_path
2+
from django.urls import path
33
from django.views.decorators.cache import cache_page
44
from django.views.generic import TemplateView
55

@@ -14,16 +14,16 @@ def cache(time=60 * 15):
1414

1515
app_name = CoreConfig.name
1616
urlpatterns = [
17-
re_path(r'^$',
17+
path('',
1818
TemplateView.as_view(template_name="core/frontpage.html"),
1919
name='fronpage'),
20-
re_path(r'^manage/servicestatus/$',
20+
path('manage/servicestatus/',
2121
views.ServiceStatusPage.as_view(),
2222
name='servicestatus'),
23-
re_path(r'^manage/servicestatus/data/$',
23+
path('manage/servicestatus/data/',
2424
cache(10)(views.ServiceStatusData.as_view()),
2525
name='servicestatus-data'),
26-
re_path(r'^manage/clear-cache/$',
26+
path('manage/clear-cache/',
2727
views.ClearCache.as_view(),
2828
name='clear-cache'),
2929
]

feedback/admin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,17 @@
1111
)
1212

1313

14+
@admin.register(Course, Exercise, Feedback, Student)
1415
class CachedAdmin(admin.ModelAdmin):
1516
def has_add_permission(self, request, obj=None): # pylint: disable=unused-argument
1617
return False
1718

1819

20+
@admin.register(FeedbackTag)
1921
class FeedbackTagAdmin(ColorTagAdmin):
2022
fields = ColorTagAdmin.fields + (
2123
'course',
2224
)
2325

2426

25-
admin.site.register(Student, CachedAdmin)
26-
admin.site.register(Course, CachedAdmin)
27-
admin.site.register(Exercise, CachedAdmin)
28-
admin.site.register(Feedback, CachedAdmin)
29-
admin.site.register(FeedbackTag, FeedbackTagAdmin)
3027
admin.site.register(ContextTag, admin.ModelAdmin)

feedback/urls.py

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.conf import settings
2+
from django.urls import path
23
from django.urls import re_path
34
from django.views.decorators.cache import cache_page
45
from .apps import FeedbackConfig
@@ -26,89 +27,89 @@
2627
app_name = FeedbackConfig.name
2728
urlpatterns = [
2829
# Aplus feedback submission
29-
re_path(r'^feedback/$',
30+
path('feedback/',
3031
FeedbackSubmissionView_view,
3132
name='submission'),
3233
re_path(r'^feedback/(?P<path_key>{path_regex}+)$'.format(path_regex=PATH_REGEX),
3334
FeedbackSubmissionView_view,
3435
name='submission'),
3536

3637
# Feedback management and responding
37-
re_path(r'^manage/$',
38+
path('manage/',
3839
views.ManageSiteListView.as_view(),
3940
name='site-list'),
40-
re_path(r'^manage/courses/$',
41+
path('manage/courses/',
4142
ManageCourseListView_view,
4243
name='course-list'),
43-
re_path(r'^manage/courses/(?P<site_id>\d+)/$',
44+
path('manage/courses/<int:site_id>/',
4445
ManageCourseListView_view,
4546
name='course-list'),
46-
re_path(r'^manage/(?P<course_id>\d+)/update-studenttags/$',
47+
path('manage/<int:course_id>/update-studenttags/',
4748
views.ManageUpdateStudenttagsView.as_view(),
4849
name='update-studenttags'),
49-
re_path(r'^manage/(?P<course_id>\d+)/unread/$',
50+
path('manage/<int:course_id>/unread/',
5051
ManageNotRespondedListView_view,
5152
name='notresponded-course'),
5253
re_path(r'^manage/(?P<course_id>\d+)/unread/(?P<path_filter>{path_regex}*)$'.format(path_regex=PATH_REGEX),
5354
ManageNotRespondedListView_view,
5455
name='notresponded-course'),
55-
re_path(r'^manage/(?P<course_id>\d+)/feedbacks/$',
56+
path('manage/<int:course_id>/feedbacks/',
5657
views.ManageFeedbacksListView.as_view(),
5758
name='list'),
58-
re_path(r'^manage/(?P<course_id>\d+)/background/(?P<student_id>\d+)/$',
59+
path('manage/<int:course_id>/background/<int:student_id>/',
5960
views.StudentBackgroundView.as_view(),
6061
name='background'),
61-
re_path(r'^manage/points/(?P<conversation_id>\d+)/$',
62+
path('manage/points/<int:conversation_id>/',
6263
views.FeedbackPointsView.as_view(),
6364
name='points'),
64-
re_path(r'^manage/(?P<course_id>\d+)/user/$',
65+
path('manage/<int:course_id>/user/',
6566
UserListView_view,
6667
name='user-list'),
67-
re_path(r'^manage/(?P<course_id>\d+)/byuser/(?P<user_id>\d+)/$',
68+
path('manage/<int:course_id>/byuser/<int:user_id>/',
6869
UserFeedbackListView_view,
6970
name='byuser'),
70-
re_path(r'^manage/(?P<course_id>\d+)/tags/$',
71+
path('manage/<int:course_id>/tags/',
7172
views.FeedbackTagListView.as_view(),
7273
name='tags'),
73-
re_path(r'^manage/(?P<course_id>\d+)/tags/(?P<tag_id>\d+)/$',
74+
path('manage/<int:course_id>/tags/<int:tag_id>/',
7475
views.FeedbackTagEditView.as_view(),
7576
name='tags-edit'),
76-
re_path(r'^manage/(?P<course_id>\d+)/tags/(?P<tag_id>\d+)/remove/$',
77+
path('manage/<int:course_id>/tags/<int:tag_id>/remove/',
7778
views.FeedbackTagDeleteView.as_view(),
7879
name='tags-remove'),
79-
re_path(r'^manage/(?P<course_id>\d+)/tags/import/$',
80+
path('manage/<int:course_id>/tags/import/',
8081
views.ImportTagsView.as_view(),
8182
name='tags-import'),
82-
re_path(r'^manage/(?P<course_id>\d+)/contexttags/$',
83+
path('manage/<int:course_id>/contexttags/',
8384
views.ContextTagListView.as_view(),
8485
name='contexttags'),
85-
re_path(r'^manage/(?P<course_id>\d+)/contexttags/(?P<tag_id>\d+)/$',
86+
path('manage/<int:course_id>/contexttags/<int:tag_id>/',
8687
views.ContextTagEditView.as_view(),
8788
name='contexttags-edit'),
88-
re_path(r'^manage/(?P<course_id>\d+)/contexttags/(?P<tag_id>\d+)/remove/$',
89+
path('manage/<int:course_id>/contexttags/<int:tag_id>/remove/',
8990
views.ContextTagDeleteView.as_view(),
9091
name='contexttags-remove'),
91-
re_path(r'^manage/respond/(?P<feedback_id>\d+)/$',
92+
path('manage/respond/<int:feedback_id>/',
9293
RespondFeedbackView_view,
9394
name='respond'),
94-
re_path(r'^manage/status/(?P<feedback_id>\d+)/$',
95+
path('manage/status/<int:feedback_id>/',
9596
views.ResponseStatusView.as_view(),
9697
name='status'),
97-
re_path(r'^manage/tag/(?P<conversation_id>\d+)/$',
98+
path('manage/tag/<int:conversation_id>/',
9899
views.FeedbackTagView.as_view(),
99100
name='tag-list'),
100-
re_path(r'^manage/tag/(?P<conversation_id>\d+)/(?P<tag_id>\d+)/$',
101+
path('manage/tag/<int:conversation_id>/<int:tag_id>/',
101102
views.FeedbackTagView.as_view(),
102103
name='tag'),
103104

104105
# support for old urls
105-
re_path(r'^manage/notresponded/course/(?P<course_id>\d+)/$',
106+
path('manage/notresponded/course/<int:course_id>/',
106107
ManageNotRespondedListView_view),
107108
re_path(r'^manage/notresponded/course/(?P<course_id>\d+)/(?P<path_filter>{path_regex}*)$'
108109
.format(path_regex=PATH_REGEX),
109110
ManageNotRespondedListView_view),
110-
re_path(r'^manage/user/(?P<course_id>\d+)/$',
111+
path('manage/user/<int:course_id>/',
111112
UserListView_view),
112-
re_path(r'^manage/byuser/(?P<course_id>\d+)/(?P<user_id>\d+)/$',
113+
path('manage/byuser/<int:course_id>/<int:user_id>/',
113114
UserFeedbackListView_view),
114115
]

jutut/urls.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010

1111
urlpatterns = [
12-
re_path(r'^', include(feedback.urls)),
13-
re_path(r'^timeusage/', include(timeusage.urls)),
14-
re_path(r'^', include(core.urls)),
15-
re_path(r'^i18n/', include('django.conf.urls.i18n')),
12+
path('', include(feedback.urls)),
13+
path('timeusage/', include(timeusage.urls)),
14+
path('', include(core.urls)),
15+
path('i18n/', include('django.conf.urls.i18n')),
1616
re_path(r'^admin/', admin.site.urls),
17-
re_path(r'^accounts/', include(accounts.urls)),
17+
path('accounts/', include(accounts.urls)),
1818
]
1919

2020
if settings.ENABLE_DJANGO_DEBUG_TOOLBAR:

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Usage: pip install -r requirements.txt
2-
Django ~= 4.2.1
2+
Django ~= 5.2.13
33
Jinja2 ~= 3.1.1
44
django-jinja ~= 2.10.0
55
django-jinja-bootstrap-form ~= 4.5.0
66
django-bootstrap5 >= 24.2
7-
git+https://github.com/apluslms/django-essentials.git@1.6.0#egg=django-essentials~=1.6.0
8-
git+https://github.com/apluslms/js-jquery-toggle.git@2.0.0#egg=js-jquery-toggle-django~=2.0.0&subdirectory=django
9-
git+https://github.com/apluslms/django-dictiterators.git@1.1.1#egg=django-dictiterators~=1.1.1
10-
git+https://github.com/apluslms/django-colortag.git@3.0.0#egg=django-colortag~=3.0.0
11-
git+https://github.com/apluslms/django-lti-login.git@3.3.0#egg=django-lti-login~=3.3.0
7+
git+https://github.com/apluslms/django-essentials.git@1.7.0#egg=django-essentials
8+
git+https://github.com/apluslms/js-jquery-toggle.git@2.0.0#egg=js-jquery-toggle-django&subdirectory=django
9+
git+https://github.com/apluslms/django-dictiterators.git@1.1.2#egg=django-dictiterators
10+
git+https://github.com/apluslms/django-colortag.git@3.1.0#egg=django-colortag
11+
git+https://github.com/apluslms/django-lti-login.git@3.4.0#egg=django-lti-login
1212
django-filter ~= 22.1
1313
django-settingsdict ~= 1.1.1
1414
celery ~= 5.3.1

timeusage/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from django.urls import re_path
1+
from django.urls import path
22
from . import views
33
from .apps import TimeUsageConfig
44

55
app_name = TimeUsageConfig.name
66
urlpatterns = [
7-
re_path(r'^(?P<course_id>\d+)/$',
7+
path('<int:course_id>/',
88
views.TimeUsageView.as_view(),
99
name='time-usage')
1010
]

0 commit comments

Comments
 (0)