Skip to content

Commit ceec50c

Browse files
committed
replace url with re_path
1 parent 3dce1e5 commit ceec50c

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

ocfweb/urls.py

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.conf.urls import include
2-
from django.conf.urls import url
2+
from django.conf.urls import re_path
33
from django.http import HttpResponse
44
from django.shortcuts import redirect
55
from django.urls import reverse
@@ -27,64 +27,64 @@
2727

2828
urlpatterns = [
2929
# test pages
30-
url(r'^test/status$', lambda _: HttpResponse('ok'), name='status'),
31-
url(r'^test/session$', test_session, name='test_session'),
32-
url(r'^test/periodic$', test_list_periodic_functions, name='test_list_periodic_functions'),
30+
re_path(r'^test/status$', lambda _: HttpResponse('ok'), name='status'),
31+
re_path(r'^test/session$', test_session, name='test_session'),
32+
re_path(r'^test/periodic$', test_list_periodic_functions, name='test_list_periodic_functions'),
3333

3434
# prometheus metrics
35-
url('', include('django_prometheus.urls')),
35+
re_path('', include('django_prometheus.urls')),
3636

37-
url(r'^$', home, name='home'),
38-
url(r'^robots\.txt$', robots_dot_txt, name='robots.txt'),
39-
url(r'^favicon.ico$', favicon, name='favicon'),
40-
url(r'^.well-known/security\.txt$', security_dot_txt, name='security.txt'),
37+
re_path(r'^$', home, name='home'),
38+
re_path(r'^robots\.txt$', robots_dot_txt, name='robots.txt'),
39+
re_path(r'^favicon.ico$', favicon, name='favicon'),
40+
re_path(r'^.well-known/security\.txt$', security_dot_txt, name='security.txt'),
4141

42-
url(r'^staff-hours$', staff_hours, name='staff-hours'),
42+
re_path(r'^staff-hours$', staff_hours, name='staff-hours'),
4343

44-
url(r'^account/', include(account)),
45-
url(r'^announcements/', include(announcements)),
46-
url(r'^docs/', include(docs)),
47-
url(r'^login/', include(login)),
48-
url(r'^stats/', include(stats)),
49-
url(r'^lab_reservations/', include(lab_reservations)),
44+
re_path(r'^account/', include(account)),
45+
re_path(r'^announcements/', include(announcements)),
46+
re_path(r'^docs/', include(docs)),
47+
re_path(r'^login/', include(login)),
48+
re_path(r'^stats/', include(stats)),
49+
re_path(r'^lab_reservations/', include(lab_reservations)),
5050

5151
# about pages
52-
url(r'^about/staff$', about_staff, name='about-staff'),
53-
url(r'^about/lab/open-source$', lab_open_source, name='lab-open-source'),
54-
url(r'^about/lab/vote$', lab_vote, name='lab-vote'),
55-
url(r'^about/lab/survey$', lab_survey, name='lab-survey'),
52+
re_path(r'^about/staff$', about_staff, name='about-staff'),
53+
re_path(r'^about/lab/open-source$', lab_open_source, name='lab-open-source'),
54+
re_path(r'^about/lab/vote$', lab_vote, name='lab-vote'),
55+
re_path(r'^about/lab/survey$', lab_survey, name='lab-survey'),
5656

5757
# tv endpoints
58-
url(r'^tv/', include(tv)),
58+
re_path(r'^tv/', include(tv)),
5959

6060
# API endpoints
61-
url(r'^api/', include(api)),
61+
re_path(r'^api/', include(api)),
6262

6363
# hosting logos
64-
url(
64+
re_path(
6565
r'^images/hosted-logos/(?:index\.shtml)?$',
6666
lambda _: redirect(reverse('doc', args=('services/vhost/badges',)), permanent=True),
6767
),
68-
url(r'^images/hosted-logos/(.*)$', lambda _, image: redirect('hosting-logo', image, permanent=True)),
69-
url(r'^hosting-logos/(.*)$', hosting_logo, name='hosting-logo'),
68+
re_path(r'^images/hosted-logos/(.*)$', lambda _, image: redirect('hosting-logo', image, permanent=True)),
69+
re_path(r'^hosting-logos/(.*)$', hosting_logo, name='hosting-logo'),
7070

7171
# legacy redirects
72-
url(r'^index\.s?html$', lambda _: redirect(reverse('home'), permanent=True)),
73-
url(r'^staff_hours(?:\.cgi)?$', lambda _: redirect(reverse('staff-hours'), permanent=True)),
74-
url(r'^staff-hours\.cgi$', lambda _: redirect(reverse('staff-hours'), permanent=True)),
75-
url(r'^OCF/(?:index\.shtml)?$', lambda _: redirect(reverse('doc', args=('about',)), permanent=True)),
76-
url(
72+
re_path(r'^index\.s?html$', lambda _: redirect(reverse('home'), permanent=True)),
73+
re_path(r'^staff_hours(?:\.cgi)?$', lambda _: redirect(reverse('staff-hours'), permanent=True)),
74+
re_path(r'^staff-hours\.cgi$', lambda _: redirect(reverse('staff-hours'), permanent=True)),
75+
re_path(r'^OCF/(?:index\.shtml)?$', lambda _: redirect(reverse('doc', args=('about',)), permanent=True)),
76+
re_path(
7777
r'^OCF/(?:past_)?officers.shtml$',
7878
lambda _: redirect(reverse('doc', args=('about/officers',)), permanent=True),
7979
),
80-
url(r'^OCF/staff/(?:index\.shtml)?$', lambda _: redirect(reverse('doc', args=('staff',)), permanent=True)),
81-
url(
80+
re_path(r'^OCF/staff/(?:index\.shtml)?$', lambda _: redirect(reverse('doc', args=('staff',)), permanent=True)),
81+
re_path(
8282
r'^OCF/staff/where-now\.shtml$',
8383
lambda _: redirect(reverse('doc', args=('about/formerstaff',)), permanent=True),
8484
),
85-
url(r'^OCF/policies(?:/|$)', lambda _: redirect(reverse('docs'), permanent=True)),
86-
url(r'^OCF/OCF_FAQ\.shtml$', lambda _: redirect(reverse('doc', args=('faq',)), permanent=True)),
87-
url(r'^OCF/officers_.*\.s?html$', lambda _: redirect(reverse('doc', args=('about/officers',)), permanent=True)),
88-
url(r'^OCF/staff/how-to-join\.shtml$', lambda _: redirect(reverse('about-staff'), permanent=True)),
89-
url(r'^mlk$', lambda _: redirect(reverse('doc', args=('services/lab',)), permanent=True)),
85+
re_path(r'^OCF/policies(?:/|$)', lambda _: redirect(reverse('docs'), permanent=True)),
86+
re_path(r'^OCF/OCF_FAQ\.shtml$', lambda _: redirect(reverse('doc', args=('faq',)), permanent=True)),
87+
re_path(r'^OCF/officers_.*\.s?html$', lambda _: redirect(reverse('doc', args=('about/officers',)), permanent=True)),
88+
re_path(r'^OCF/staff/how-to-join\.shtml$', lambda _: redirect(reverse('about-staff'), permanent=True)),
89+
re_path(r'^mlk$', lambda _: redirect(reverse('doc', args=('services/lab',)), permanent=True)),
9090
]

0 commit comments

Comments
 (0)