diff --git a/allianceauth/groupmanagement/urls.py b/allianceauth/groupmanagement/urls.py index 435761ca..a1c5a01d 100644 --- a/allianceauth/groupmanagement/urls.py +++ b/allianceauth/groupmanagement/urls.py @@ -1,50 +1,49 @@ +from django.urls import re_path from . import views -from django.conf.urls import url - app_name = "groupmanagement" urlpatterns = [ # groups - url(r"^groups/$", views.groups_view, name="groups"), - url(r"^group/request/join/(\w+)/$", views.group_request_add, name="request_add"), - url( + re_path(r"^groups/$", views.groups_view, name="groups"), + re_path(r"^group/request/join/(\w+)/$", views.group_request_add, name="request_add"), + re_path( r"^group/request/leave/(\w+)/$", views.group_request_leave, name="request_leave" ), # group management - url(r"^groupmanagement/requests/$", views.group_management, name="management"), - url(r"^groupmanagement/membership/$", views.group_membership, name="membership"), - url( + re_path(r"^groupmanagement/requests/$", views.group_management, name="management"), + re_path(r"^groupmanagement/membership/$", views.group_membership, name="membership"), + re_path( r"^groupmanagement/membership/(\w+)/$", views.group_membership_list, name="membership", ), - url( + re_path( r"^groupmanagement/membership/(\w+)/audit-log/$", views.group_membership_audit, name="audit_log", ), - url( + re_path( r"^groupmanagement/membership/(\w+)/remove/(\w+)/$", views.group_membership_remove, name="membership_remove", ), - url( + re_path( r"^groupmanagement/request/join/accept/(\w+)/$", views.group_accept_request, name="accept_request", ), - url( + re_path( r"^groupmanagement/request/join/reject/(\w+)/$", views.group_reject_request, name="reject_request", ), - url( + re_path( r"^groupmanagement/request/leave/accept/(\w+)/$", views.group_leave_accept_request, name="leave_accept_request", ), - url( + re_path( r"^groupmanagement/request/leave/reject/(\w+)/$", views.group_leave_reject_request, name="leave_reject_request", diff --git a/allianceauth/hrapplications/urls.py b/allianceauth/hrapplications/urls.py index efbcfe4a..e6dc2783 100644 --- a/allianceauth/hrapplications/urls.py +++ b/allianceauth/hrapplications/urls.py @@ -1,31 +1,31 @@ -from django.conf.urls import url +from django.urls import re_path from . import views app_name = 'hrapplications' urlpatterns = [ - url(r'^$', views.hr_application_management_view, + re_path(r'^$', views.hr_application_management_view, name="index"), - url(r'^create/$', views.hr_application_create_view, + re_path(r'^create/$', views.hr_application_create_view, name="create_view"), - url(r'^create/(\d+)', views.hr_application_create_view, + re_path(r'^create/(\d+)', views.hr_application_create_view, name="create_view"), - url(r'^remove/(\w+)', views.hr_application_remove, + re_path(r'^remove/(\w+)', views.hr_application_remove, name="remove"), - url(r'^view/(\w+)', views.hr_application_view, + re_path(r'^view/(\w+)', views.hr_application_view, name="view"), - url(r'^personal/view/(\w+)', views.hr_application_personal_view, + re_path(r'^personal/view/(\w+)', views.hr_application_personal_view, name="personal_view"), - url(r'^personal/removal/(\w+)', + re_path(r'^personal/removal/(\w+)', views.hr_application_personal_removal, name="personal_removal"), - url(r'^approve/(\w+)', views.hr_application_approve, + re_path(r'^approve/(\w+)', views.hr_application_approve, name="approve"), - url(r'^reject/(\w+)', views.hr_application_reject, + re_path(r'^reject/(\w+)', views.hr_application_reject, name="reject"), - url(r'^search/', views.hr_application_search, + re_path(r'^search/', views.hr_application_search, name="search"), - url(r'^mark_in_progress/(\w+)', views.hr_application_mark_in_progress, + re_path(r'^mark_in_progress/(\w+)', views.hr_application_mark_in_progress, name="mark_in_progress"), ] diff --git a/allianceauth/notifications/urls.py b/allianceauth/notifications/urls.py index eeeecfc9..b9e849ad 100644 --- a/allianceauth/notifications/urls.py +++ b/allianceauth/notifications/urls.py @@ -1,15 +1,15 @@ -from django.conf.urls import url +from django.urls import re_path from . import views app_name = 'notifications' # Notifications urlpatterns = [ - url(r'^remove_notifications/(\w+)/$', views.remove_notification, name='remove'), - url(r'^notifications/mark_all_read/$', views.mark_all_read, name='mark_all_read'), - url(r'^notifications/delete_all_read/$', views.delete_all_read, name='delete_all_read'), - url(r'^notifications/$', views.notification_list, name='list'), - url(r'^notifications/(\w+)/$', views.notification_view, name='view'), - url( + re_path(r'^remove_notifications/(\w+)/$', views.remove_notification, name='remove'), + re_path(r'^notifications/mark_all_read/$', views.mark_all_read, name='mark_all_read'), + re_path(r'^notifications/delete_all_read/$', views.delete_all_read, name='delete_all_read'), + re_path(r'^notifications/$', views.notification_list, name='list'), + re_path(r'^notifications/(\w+)/$', views.notification_view, name='view'), + re_path( r'^user_notifications_count/(?P\d+)/$', views.user_notifications_count, name='user_notifications_count' diff --git a/allianceauth/optimer/urls.py b/allianceauth/optimer/urls.py index bbdb28ff..a90a9f5f 100644 --- a/allianceauth/optimer/urls.py +++ b/allianceauth/optimer/urls.py @@ -1,12 +1,12 @@ -from django.conf.urls import url +from django.urls import re_path from . import views app_name = 'optimer' urlpatterns = [ - url(r'^$', views.optimer_view, name='view'), - url(r'^add$', views.add_optimer_view, name='add'), - url(r'^(\w+)/remove$', views.remove_optimer, name='remove'), - url(r'^(\w+)/edit$', views.edit_optimer, name='edit'), + re_path(r'^$', views.optimer_view, name='view'), + re_path(r'^add$', views.add_optimer_view, name='add'), + re_path(r'^(\w+)/remove$', views.remove_optimer, name='remove'), + re_path(r'^(\w+)/edit$', views.edit_optimer, name='edit'), ] diff --git a/allianceauth/permissions_tool/urls.py b/allianceauth/permissions_tool/urls.py index b0e1b6a9..bf4b1c04 100644 --- a/allianceauth/permissions_tool/urls.py +++ b/allianceauth/permissions_tool/urls.py @@ -1,11 +1,11 @@ -from django.conf.urls import url +from django.urls import re_path from . import views app_name = 'permissions_tool' urlpatterns = [ - url(r'^overview/$', views.permissions_overview, name='overview'), - url(r'^audit/(?P[\w\-_]+)/(?P[\w\-_]+)/(?P[\w\-_]+)/$', views.permissions_audit, + re_path(r'^overview/$', views.permissions_overview, name='overview'), + re_path(r'^audit/(?P[\w\-_]+)/(?P[\w\-_]+)/(?P[\w\-_]+)/$', views.permissions_audit, name='audit'), ] diff --git a/allianceauth/project_template/project_name/urls.py b/allianceauth/project_template/project_name/urls.py index e9afaaf0..803ef102 100644 --- a/allianceauth/project_template/project_name/urls.py +++ b/allianceauth/project_template/project_name/urls.py @@ -1,8 +1,9 @@ -from django.conf.urls import include, url +from django.conf.urls import include from allianceauth import urls +from django.urls import re_path urlpatterns = [ - url(r'', include(urls)), + re_path(r'', include(urls)), ] handler500 = 'allianceauth.views.Generic500Redirect' diff --git a/allianceauth/services/modules/discord/urls.py b/allianceauth/services/modules/discord/urls.py index 30f48937..3e9af992 100644 --- a/allianceauth/services/modules/discord/urls.py +++ b/allianceauth/services/modules/discord/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,13 +7,13 @@ app_name = 'discord' module_urls = [ # Discord Service Control - url(r'^activate/$', views.activate_discord, name='activate'), - url(r'^deactivate/$', views.deactivate_discord, name='deactivate'), - url(r'^reset/$', views.reset_discord, name='reset'), - url(r'^callback/$', views.discord_callback, name='callback'), - url(r'^add_bot/$', views.discord_add_bot, name='add_bot'), + re_path(r'^activate/$', views.activate_discord, name='activate'), + re_path(r'^deactivate/$', views.deactivate_discord, name='deactivate'), + re_path(r'^reset/$', views.reset_discord, name='reset'), + re_path(r'^callback/$', views.discord_callback, name='callback'), + re_path(r'^add_bot/$', views.discord_add_bot, name='add_bot'), ] urlpatterns = [ - url(r'^discord/', include((module_urls, app_name), namespace=app_name)) + re_path(r'^discord/', include((module_urls, app_name), namespace=app_name)) ] diff --git a/allianceauth/services/modules/discourse/urls.py b/allianceauth/services/modules/discourse/urls.py index 207bedc4..e0cd1e7b 100644 --- a/allianceauth/services/modules/discourse/urls.py +++ b/allianceauth/services/modules/discourse/urls.py @@ -1,8 +1,8 @@ -from django.conf.urls import url +from django.urls import re_path from . import views urlpatterns = [ # Discourse Service Control - url(r'^discourse/sso$', views.discourse_sso, name='auth_discourse_sso'), + re_path(r'^discourse/sso$', views.discourse_sso, name='auth_discourse_sso'), ] diff --git a/allianceauth/services/modules/example/urls.py b/allianceauth/services/modules/example/urls.py index f72d9abd..fb1edaad 100644 --- a/allianceauth/services/modules/example/urls.py +++ b/allianceauth/services/modules/example/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path app_name = 'example' @@ -7,5 +8,5 @@ module_urls = [ ] urlpatterns = [ - url(r'^example/', include((module_urls, app_name), namespace=app_name)), + re_path(r'^example/', include((module_urls, app_name), namespace=app_name)), ] diff --git a/allianceauth/services/modules/ips4/urls.py b/allianceauth/services/modules/ips4/urls.py index a13a98e6..ceaf9572 100644 --- a/allianceauth/services/modules/ips4/urls.py +++ b/allianceauth/services/modules/ips4/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,12 +7,12 @@ app_name = 'ips4' module_urls = [ # IPS4 Service Control - url(r'^activate/$', views.activate_ips4, name='activate'), - url(r'^deactivate/$', views.deactivate_ips4, name='deactivate'), - url(r'^reset_password/$', views.reset_ips4_password, name='reset_password'), - url(r'^set_password/$', views.set_ips4_password, name='set_password'), + re_path(r'^activate/$', views.activate_ips4, name='activate'), + re_path(r'^deactivate/$', views.deactivate_ips4, name='deactivate'), + re_path(r'^reset_password/$', views.reset_ips4_password, name='reset_password'), + re_path(r'^set_password/$', views.set_ips4_password, name='set_password'), ] urlpatterns = [ - url(r'^ips4/', include((module_urls, app_name), namespace=app_name)) + re_path(r'^ips4/', include((module_urls, app_name), namespace=app_name)) ] diff --git a/allianceauth/services/modules/mumble/urls.py b/allianceauth/services/modules/mumble/urls.py index 03787422..586342e3 100644 --- a/allianceauth/services/modules/mumble/urls.py +++ b/allianceauth/services/modules/mumble/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,12 +7,12 @@ app_name = 'mumble' module_urls = [ # Mumble service control - url(r'^activate/$', views.CreateAccountMumbleView.as_view(), name='activate'), - url(r'^deactivate/$', views.DeleteMumbleView.as_view(), name='deactivate'), - url(r'^reset_password/$', views.ResetPasswordMumbleView.as_view(), name='reset_password'), - url(r'^set_password/$', views.SetPasswordMumbleView.as_view(), name='set_password'), + re_path(r'^activate/$', views.CreateAccountMumbleView.as_view(), name='activate'), + re_path(r'^deactivate/$', views.DeleteMumbleView.as_view(), name='deactivate'), + re_path(r'^reset_password/$', views.ResetPasswordMumbleView.as_view(), name='reset_password'), + re_path(r'^set_password/$', views.SetPasswordMumbleView.as_view(), name='set_password'), ] urlpatterns = [ - url(r'^mumble/', include((module_urls, app_name), namespace=app_name)) + re_path(r'^mumble/', include((module_urls, app_name), namespace=app_name)) ] diff --git a/allianceauth/services/modules/openfire/urls.py b/allianceauth/services/modules/openfire/urls.py index 230d9fb4..e24319f2 100644 --- a/allianceauth/services/modules/openfire/urls.py +++ b/allianceauth/services/modules/openfire/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,13 +7,13 @@ app_name = 'openfire' module_urls = [ # Jabber Service Control - url(r'^activate/$', views.activate_jabber, name='activate'), - url(r'^deactivate/$', views.deactivate_jabber, name='deactivate'), - url(r'^reset_password/$', views.reset_jabber_password, name='reset_password'), - url(r'^set_password/$', views.set_jabber_password, name='set_password'), - url(r'^broadcast/$', views.jabber_broadcast_view, name='broadcast'), + re_path(r'^activate/$', views.activate_jabber, name='activate'), + re_path(r'^deactivate/$', views.deactivate_jabber, name='deactivate'), + re_path(r'^reset_password/$', views.reset_jabber_password, name='reset_password'), + re_path(r'^set_password/$', views.set_jabber_password, name='set_password'), + re_path(r'^broadcast/$', views.jabber_broadcast_view, name='broadcast'), ] urlpatterns = [ - url(r'^openfire/', include((module_urls, app_name), namespace=app_name)), + re_path(r'^openfire/', include((module_urls, app_name), namespace=app_name)), ] diff --git a/allianceauth/services/modules/phpbb3/urls.py b/allianceauth/services/modules/phpbb3/urls.py index 26611469..a9de3356 100644 --- a/allianceauth/services/modules/phpbb3/urls.py +++ b/allianceauth/services/modules/phpbb3/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,12 +7,12 @@ app_name = 'phpbb3' module_urls = [ # Forum Service Control - url(r'^activate/$', views.activate_forum, name='activate'), - url(r'^deactivate/$', views.deactivate_forum, name='deactivate'), - url(r'^reset_password/$', views.reset_forum_password, name='reset_password'), - url(r'^set_password/$', views.set_forum_password, name='set_password'), + re_path(r'^activate/$', views.activate_forum, name='activate'), + re_path(r'^deactivate/$', views.deactivate_forum, name='deactivate'), + re_path(r'^reset_password/$', views.reset_forum_password, name='reset_password'), + re_path(r'^set_password/$', views.set_forum_password, name='set_password'), ] urlpatterns = [ - url(r'^phpbb3/', include((module_urls, app_name), namespace=app_name)) + re_path(r'^phpbb3/', include((module_urls, app_name), namespace=app_name)) ] diff --git a/allianceauth/services/modules/smf/urls.py b/allianceauth/services/modules/smf/urls.py index 59e396bf..e5a079b4 100644 --- a/allianceauth/services/modules/smf/urls.py +++ b/allianceauth/services/modules/smf/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,12 +7,12 @@ app_name = 'smf' module_urls = [ # SMF Service Control - url(r'^activate/$', views.activate_smf, name='activate'), - url(r'^deactivate/$', views.deactivate_smf, name='deactivate'), - url(r'^reset_password/$', views.reset_smf_password, name='reset_password'), - url(r'^set_password/$', views.set_smf_password, name='set_password'), + re_path(r'^activate/$', views.activate_smf, name='activate'), + re_path(r'^deactivate/$', views.deactivate_smf, name='deactivate'), + re_path(r'^reset_password/$', views.reset_smf_password, name='reset_password'), + re_path(r'^set_password/$', views.set_smf_password, name='set_password'), ] urlpatterns = [ - url(r'^smf/', include((module_urls, app_name), namespace=app_name)), + re_path(r'^smf/', include((module_urls, app_name), namespace=app_name)), ] diff --git a/allianceauth/services/modules/teamspeak3/urls.py b/allianceauth/services/modules/teamspeak3/urls.py index d46bf0c2..420753fa 100644 --- a/allianceauth/services/modules/teamspeak3/urls.py +++ b/allianceauth/services/modules/teamspeak3/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,19 +7,19 @@ app_name = 'teamspeak3' module_urls = [ # Teamspeak3 service control - url(r'^activate/$', views.activate_teamspeak3, name='activate'), - url(r'^deactivate/$', views.deactivate_teamspeak3, name='deactivate'), - url(r'^reset_perm/$', views.reset_teamspeak3_perm, name='reset_perm'), - url( + re_path(r'^activate/$', views.activate_teamspeak3, name='activate'), + re_path(r'^deactivate/$', views.deactivate_teamspeak3, name='deactivate'), + re_path(r'^reset_perm/$', views.reset_teamspeak3_perm, name='reset_perm'), + re_path( r'^admin_update_ts3_groups/$', views.admin_update_ts3_groups, name='admin_update_ts3_groups' ), # Teamspeak Urls - url(r'^verify/$', views.verify_teamspeak3, name='verify'), + re_path(r'^verify/$', views.verify_teamspeak3, name='verify'), ] urlpatterns = [ - url(r'^teamspeak3/', include((module_urls, app_name), namespace=app_name)), + re_path(r'^teamspeak3/', include((module_urls, app_name), namespace=app_name)), ] diff --git a/allianceauth/services/modules/xenforo/urls.py b/allianceauth/services/modules/xenforo/urls.py index 123e7bfe..bcb6a2a2 100644 --- a/allianceauth/services/modules/xenforo/urls.py +++ b/allianceauth/services/modules/xenforo/urls.py @@ -1,4 +1,5 @@ -from django.conf.urls import url, include +from django.conf.urls import include +from django.urls import re_path from . import views @@ -6,12 +7,12 @@ app_name = 'xenforo' module_urls = [ # XenForo service control - url(r'^activate/$', views.activate_xenforo_forum, name='activate'), - url(r'^deactivate/$', views.deactivate_xenforo_forum, name='deactivate'), - url(r'^reset_password/$', views.reset_xenforo_password, name='reset_password'), - url(r'^set_password/$', views.set_xenforo_password, name='set_password'), + re_path(r'^activate/$', views.activate_xenforo_forum, name='activate'), + re_path(r'^deactivate/$', views.deactivate_xenforo_forum, name='deactivate'), + re_path(r'^reset_password/$', views.reset_xenforo_password, name='reset_password'), + re_path(r'^set_password/$', views.set_xenforo_password, name='set_password'), ] urlpatterns = [ - url(r'^xenforo/', include((module_urls, app_name), namespace=app_name)), + re_path(r'^xenforo/', include((module_urls, app_name), namespace=app_name)), ] diff --git a/allianceauth/services/urls.py b/allianceauth/services/urls.py index 0503d292..c7a0fb41 100644 --- a/allianceauth/services/urls.py +++ b/allianceauth/services/urls.py @@ -1,14 +1,15 @@ -from django.conf.urls import include, url +from django.conf.urls import include from allianceauth.hooks import get_hooks +from django.urls import re_path from . import views urlpatterns = [ # Services - url(r'^services/', include(([ - url(r'^$', views.services_view, name='services'), + re_path(r'^services/', include(([ + re_path(r'^$', views.services_view, name='services'), # Tools - url(r'^tool/fleet_formatter_tool/$', views.fleet_formatter_view, name='fleet_format_tool'), + re_path(r'^tool/fleet_formatter_tool/$', views.fleet_formatter_view, name='fleet_format_tool'), ], 'services'), namespace='services')), ] diff --git a/allianceauth/srp/urls.py b/allianceauth/srp/urls.py index d357a7ce..45f8fab8 100644 --- a/allianceauth/srp/urls.py +++ b/allianceauth/srp/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url +from django.urls import re_path from . import views @@ -6,27 +6,27 @@ app_name = 'srp' urlpatterns = [ # SRP URLS - url(r'^$', views.srp_management, name='management'), - url(r'^all/$', views.srp_management, {'all': True}, name='all'), - url(r'^(\w+)/view$', views.srp_fleet_view, name='fleet'), - url(r'^add/$', views.srp_fleet_add_view, name='add'), - url(r'^(\w+)/edit$', views.srp_fleet_edit_view, name='edit'), - url(r'^(\w+)/request', views.srp_request_view, name='request'), + re_path(r'^$', views.srp_management, name='management'), + re_path(r'^all/$', views.srp_management, {'all': True}, name='all'), + re_path(r'^(\w+)/view$', views.srp_fleet_view, name='fleet'), + re_path(r'^add/$', views.srp_fleet_add_view, name='add'), + re_path(r'^(\w+)/edit$', views.srp_fleet_edit_view, name='edit'), + re_path(r'^(\w+)/request', views.srp_request_view, name='request'), # SRP URLS - url(r'^(\w+)/remove$', views.srp_fleet_remove, name='remove'), - url(r'^(\w+)/disable$', views.srp_fleet_disable, name='disable'), - url(r'^(\w+)/enable$', views.srp_fleet_enable, name='enable'), - url(r'^(\w+)/complete$', views.srp_fleet_mark_completed, + re_path(r'^(\w+)/remove$', views.srp_fleet_remove, name='remove'), + re_path(r'^(\w+)/disable$', views.srp_fleet_disable, name='disable'), + re_path(r'^(\w+)/enable$', views.srp_fleet_enable, name='enable'), + re_path(r'^(\w+)/complete$', views.srp_fleet_mark_completed, name='mark_completed'), - url(r'^(\w+)/incomplete$', views.srp_fleet_mark_uncompleted, + re_path(r'^(\w+)/incomplete$', views.srp_fleet_mark_uncompleted, name='mark_uncompleted'), - url(r'^request/remove/', views.srp_request_remove, + re_path(r'^request/remove/', views.srp_request_remove, name="request_remove"), - url(r'^request/approve/', views.srp_request_approve, + re_path(r'^request/approve/', views.srp_request_approve, name='request_approve'), - url(r'^request/reject/', views.srp_request_reject, + re_path(r'^request/reject/', views.srp_request_reject, name='request_reject'), - url(r'^request/(\w+)/update', views.srp_request_update_amount, + re_path(r'^request/(\w+)/update', views.srp_request_update_amount, name="request_update_amount"), ] diff --git a/allianceauth/timerboard/urls.py b/allianceauth/timerboard/urls.py index d4102494..c9de7a5c 100644 --- a/allianceauth/timerboard/urls.py +++ b/allianceauth/timerboard/urls.py @@ -1,12 +1,12 @@ -from django.conf.urls import url +from django.urls import re_path from . import views app_name = 'timerboard' urlpatterns = [ - url(r'^$', views.TimerView.as_view(), name='view'), - url(r'^add/$', views.AddTimerView.as_view(), name='add'), - url(r'^remove/(?P\w+)$', views.RemoveTimerView.as_view(), name='delete'), - url(r'^edit/(?P\w+)$', views.EditTimerView.as_view(), name='edit'), + re_path(r'^$', views.TimerView.as_view(), name='view'), + re_path(r'^add/$', views.AddTimerView.as_view(), name='add'), + re_path(r'^remove/(?P\w+)$', views.RemoveTimerView.as_view(), name='delete'), + re_path(r'^edit/(?P\w+)$', views.EditTimerView.as_view(), name='edit'), ] diff --git a/docs/customizing/index.md b/docs/customizing/index.md index 99df4759..6105589d 100644 --- a/docs/customizing/index.md +++ b/docs/customizing/index.md @@ -33,7 +33,7 @@ It is possible to add or override URLs with your auth project's URL config file. import allianceauth.urls urlpatterns = [ - url(r'', include(allianceauth.urls)), + re_path(r'', include(allianceauth.urls)), ] ``` @@ -46,8 +46,8 @@ import allianceauth.urls import myauth.views urlpatterns = [ - url(r'', include(allianceauth.urls)), - url(r'myview/$', myauth.views.myview, name='myview'), + re_path(r'', include(allianceauth.urls)), + re_path(r'myview/$', myauth.views.myview, name='myview'), ] ``` @@ -58,7 +58,7 @@ import allianceauth.urls import myauth.views urlpatterns = [ - url(r'account/login/$', myauth.views.login, name='auth_login_user'), - url(r'', include(allianceauth.urls)), + re_path(r'account/login/$', myauth.views.login, name='auth_login_user'), + re_path(r'', include(allianceauth.urls)), ] ``` diff --git a/docs/development/custom/url-hooks.md b/docs/development/custom/url-hooks.md index 95d39da6..d0698351 100644 --- a/docs/development/custom/url-hooks.md +++ b/docs/development/custom/url-hooks.md @@ -38,7 +38,7 @@ The app's `urls.py` would look like so: import plugin.views urlpatterns = [ - url(r^'index$', plugins.views.index, name='index'), + re_path(r^'index$', plugins.views.index, name='index'), ] Subsequently it would implement the UrlHook in a dedicated `auth_hooks.py` file like so: diff --git a/tests/urls.py b/tests/urls.py index 12f563e6..423ce0c0 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,15 +1,14 @@ -from django.conf.urls import url - import allianceauth.urls +from django.urls import re_path from . import views urlpatterns = allianceauth.urls.urlpatterns urlpatterns += [ # Navhelper test urls - url(r'^main-page/$', views.page, name='p1'), - url(r'^main-page/sub-section/$', views.page, name='p1-s1'), - url(r'^second-page/$', views.page, name='p1'), + re_path(r'^main-page/$', views.page, name='p1'), + re_path(r'^main-page/sub-section/$', views.page, name='p1-s1'), + re_path(r'^second-page/$', views.page, name='p1'), ] handler500 = 'allianceauth.views.Generic500Redirect'