[extensions-web/vbump/django] Upgrade to Django 3.2 and fix deprecation notices




commit 7404e177933cc4e39b5a73b8da44c9f986de19b8
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sat Jan 15 12:28:37 2022 +0400

    Upgrade to Django 3.2 and fix deprecation notices

 requirements.txt                  | 69 ++++++++++++++++++---------------------
 sweettooth/auth/forms.py          |  2 +-
 sweettooth/auth/tests.py          |  3 +-
 sweettooth/auth/urls.py           | 36 ++++++++++----------
 sweettooth/errorreports/models.py |  3 +-
 sweettooth/errorreports/urls.py   |  6 ++--
 sweettooth/extensions/models.py   |  9 +++--
 sweettooth/extensions/urls.py     | 43 ++++++++++++------------
 sweettooth/ratings/admin.py       |  2 +-
 sweettooth/ratings/urls.py        |  6 ++--
 sweettooth/review/urls.py         | 16 ++++-----
 sweettooth/urls.py                | 25 +++++++-------
 12 files changed, 111 insertions(+), 109 deletions(-)
---
diff --git a/requirements.txt b/requirements.txt
index ed1ec76..a8fe3f3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,44 +1,39 @@
-Django==2.2.24 \
-    --hash=sha256:3339ff0e03dee13045aef6ae7b523edff75b6d726adf7a7a48f53d5a501f7db7 \
-    --hash=sha256:f2084ceecff86b1e631c2cd4107d435daf4e12f1efcdf11061a73bf0b5e95f92
+Django==3.2.11 \
+    --hash=sha256:0a0a37f0b93aef30c4bf3a839c187e1175bcdeb7e177341da0cb7b8194416891 \
+    --hash=sha256:69c94abe5d6b1b088bf475e09b7b74403f943e34da107e798465d2045da27e75
 django-autoslug==1.9.8 \
     --hash=sha256:26459eeddec207e307c55777a10fc25d17f4978753695340b16a17ed248a6f70 \
     --hash=sha256:bae66c27d35615f472865b99c4d107f3b3add3d22ee337e84960fc07694abd45
-django-contrib-comments==1.9.2 \
-    --hash=sha256:b83320a86081a76bc0570e6cc0f924c0ced40b46ae9f5dd783ab2c745b449529 \
-    --hash=sha256:d1232bade3094de07dcc205fc833204384e71ba9d30caadcb5bb2882ce8e8d31
-django-registration==3.1.2 \
-    --hash=sha256:c9985f9ffd123534026bf5f39adb0b48fd7bf930b965f27f9a487d135f377ac6 \
-    --hash=sha256:dde525b08880da1d72b556f19dfd1c6588233a43f8bc354481f2d3e8896c44f8
-Pygments==2.8.1 \
-    --hash=sha256:2656e1a6edcdabf4275f9a3640db59fd5de107d88e8663c5d4e9a0fa62f77f94 \
-    --hash=sha256:534ef71d539ae97d4c3a4cf7d6f110f214b0e687e92f9cb9d2a3b0d3101289c8
-Pillow==8.3.2 \
-    --hash=sha256:11eb7f98165d56042545c9e6db3ce394ed8b45089a67124298f0473b29cb60b2 \
-    --hash=sha256:15ccb81a6ffc57ea0137f9f3ac2737ffa1d11f786244d719639df17476d399a7 \
-    --hash=sha256:19ec4cfe4b961edc249b0e04b5618666c23a83bc35842dea2bfd5dfa0157f81b \
-    --hash=sha256:2f23b2d3079522fdf3c09de6517f625f7a964f916c956527bed805ac043799b8 \
-    --hash=sha256:4abc247b31a98f29e5224f2d31ef15f86a71f79c7f4d2ac345a5d551d6393073 \
-    --hash=sha256:8f284dc1695caf71a74f24993b7c7473d77bc760be45f776a2c2f4e04c170550 \
-    --hash=sha256:a048dad5ed6ad1fad338c02c609b862dfaa921fcd065d747194a6805f91f2196 \
-    --hash=sha256:dde3f3ed8d00c72631bc19cbfff8ad3b6215062a5eed402381ad365f82f0c18c \
-    --hash=sha256:e5a31c07cea5edbaeb4bdba6f2b87db7d3dc0f446f379d907e51cc70ea375629
-polib==1.1.0 \
-    --hash=sha256:93b730477c16380c9a96726c54016822ff81acfa553977fdd131f2b90ba858d7 \
-    --hash=sha256:fad87d13696127ffb27ea0882d6182f1a9cf8a5e2b37a587751166c51e5a332a
-chardet==3.0.4 \
-    --hash=sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae \
-    --hash=sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691
+django-contrib-comments==2.1.0 \
+    --hash=sha256:d82f1d04690550df026553053903deec0c52dc54212e1b79241b08f0355cff2c \
+    --hash=sha256:e02c7341ea1f4bcdfa347851dbf5e632d3e591d84b4f77de2f90b93398897f3c
+django-registration==3.2 \
+    --hash=sha256:2ea8c7d89a8760ccde41dfd335aa28ba89073d09aab5a0f5f3d7c8c148fcc518 \
+    --hash=sha256:e79fdbfa22bfaf4182efccb6604391391a7de19438d2669c5b9520a7708efbd2
+Pygments==2.11.2 \
+    --hash=sha256:44238f1b60a76d78fc8ca0528ee429702aae011c265fe6a8dd8b63049ae41c65 \
+    --hash=sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a
+Pillow==9.0.0 \
+    --hash=sha256:ee6e2963e92762923956fe5d3479b1fdc3b76c83f290aad131a2f98c3df0593e
+polib==1.1.1 \
+    --hash=sha256:d3ee85e0c6788f789353416b1612c6c92d75fe6ccfac0029711974d6abd0f86d \
+    --hash=sha256:e02c355ae5e054912e3b0d16febc56510eff7e49d60bf22aecb463bd2f2a2dfa
+chardet==4.0.0 \
+    --hash=sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa \
+    --hash=sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5
 dj-database-url==0.5.0 \
     --hash=sha256:4aeaeb1f573c74835b0686a2b46b85990571159ffc21aa57ecd4d1e1cb334163 \
     --hash=sha256:851785365761ebe4994a921b433062309eb882fedd318e1b0fcecc607ed02da9
-dj-email-url==1.0.1 \
-    --hash=sha256:32dc567c5cc3d4106710ec36dd645c8c1b20e2d8f588a17ab88bcc23e347d00a \
-    --hash=sha256:557c07b3039befdc1c561c4038b155d659c09f996d5e33c91189c2e23969da90
+dj-email-url==1.0.2 \
+    --hash=sha256:15148141c6ef123636e4ca3663e95231ed94ca5ed267e91977e5a4397be8b34c \
+    --hash=sha256:838fd4ded9deba53ae757debef431e25fa7fca31d3948b3c4808ccdc84fab2b7
 # Django dependencies
-pytz==2020.4 \
-    --hash=sha256:3e6b7dd2d1e0a59084bcee14a17af60c5c562cdc16d828e8eba2e683d3a7e268 \
-    --hash=sha256:5c55e189b682d420be27c6995ba6edce0c0a77dd67bfbe2ae6607134d5851ffd
+asgiref==3.4.1 \
+    --hash=sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9 \
+    --hash=sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214
+pytz==2021.3 \
+    --hash=sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c \
+    --hash=sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326
 sqlparse==0.4.2 \
     --hash=sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae \
     --hash=sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d
@@ -47,6 +42,6 @@ confusable_homoglyphs==3.2.0 \
     --hash=sha256:3b4a0d9fa510669498820c91a0bfc0c327568cecec90648cf3819d4a6fc6a751 \
     --hash=sha256:e3ce611028d882b74a5faa69e3cbb5bd4dcd9f69936da6e73d33eda42c917944
 # django-contrib-comments dependency
-six==1.15.0 \
-    --hash=sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259 \
-    --hash=sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced
+six==1.16.0 \
+    --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
+    --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
diff --git a/sweettooth/auth/forms.py b/sweettooth/auth/forms.py
index c92148c..c9c4291 100644
--- a/sweettooth/auth/forms.py
+++ b/sweettooth/auth/forms.py
@@ -1,7 +1,7 @@
 
 from django import forms
 from django.contrib.auth import forms as auth_forms
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 from django_registration.forms import RegistrationFormCaseInsensitive, RegistrationFormUniqueEmail
 
 class PlainOutputForm(object):
diff --git a/sweettooth/auth/tests.py b/sweettooth/auth/tests.py
index 270951b..d22e106 100644
--- a/sweettooth/auth/tests.py
+++ b/sweettooth/auth/tests.py
@@ -8,11 +8,12 @@
     (at your option) any later version.
 """
 
+from six import text_type
+
 from django_registration import validators
 
 from django.contrib.auth import get_user_model
 from django.test.testcases import TestCase
-from django.utils.six import text_type
 from .forms import AutoFocusRegistrationForm, RegistrationForm
 
 User = get_user_model()
diff --git a/sweettooth/auth/urls.py b/sweettooth/auth/urls.py
index 1ae8dcd..ca5f5d3 100644
--- a/sweettooth/auth/urls.py
+++ b/sweettooth/auth/urls.py
@@ -1,53 +1,53 @@
 
 from django.views.generic.base import TemplateView
-from django.conf.urls import url, include
+from django.conf.urls import include
 from django_registration.backends.activation.views import RegistrationView
 from django.contrib.auth import views as auth_views
 from django.contrib.auth.views import LoginView, LogoutView
-from django.urls import reverse_lazy
+from django.urls import re_path
 from sweettooth.auth import views, forms
 
 urlpatterns = [
-    url(r'^login/', LoginView.as_view(form_class=forms.AuthenticationForm), name='auth-login'),
+    re_path(r'^login/', LoginView.as_view(form_class=forms.AuthenticationForm), name='auth-login'),
 
-    url(r'^change_display_name/(?P<pk>\d+)', views.ajax_change_display_name),
+    re_path(r'^change_display_name/(?P<pk>\d+)', views.ajax_change_display_name),
 
-    url(r'^logout/', LogoutView.as_view(next_page='/'), name='auth-logout'),
+    re_path(r'^logout/', LogoutView.as_view(next_page='/'), name='auth-logout'),
 
-    url(r'^register/$', RegistrationView.as_view(form_class=forms.AutoFocusRegistrationForm),
+    re_path(r'^register/$', RegistrationView.as_view(form_class=forms.AutoFocusRegistrationForm),
         name='registration_register'),
 
-    url(r'settings/(?P<user>.+)', TemplateView.as_view(template_name='profile/settings.html'),
+    re_path(r'settings/(?P<user>.+)', TemplateView.as_view(template_name='profile/settings.html'),
         name='auth-settings'),
 
-    url(r'', include('django_registration.backends.activation.urls')),
-    url(r'^profile/(?P<user>.+)', views.profile, name='auth-profile'),
-    url(r'^profile/', views.profile_redirect, name='auth-profile'),
+    re_path(r'', include('django_registration.backends.activation.urls')),
+    re_path(r'^profile/(?P<user>.+)', views.profile, name='auth-profile'),
+    re_path(r'^profile/', views.profile_redirect, name='auth-profile'),
 
-    url(r'^login/$',
+    re_path(r'^login/$',
         auth_views.LoginView.as_view(),
         name='auth-login'),
-    url(r'^logout/$',
+    re_path(r'^logout/$',
         auth_views.LogoutView.as_view(),
         name='auth-logout'),
-    url(r'^password/change/$',
+    re_path(r'^password/change/$',
         auth_views.PasswordChangeView.as_view(),
         name='password_change'),
-    url(r'^password/change/done/$',
+    re_path(r'^password/change/done/$',
         auth_views.PasswordChangeDoneView.as_view(),
         name='password_change_done'),
-    url(r'^password/reset/$',
+    re_path(r'^password/reset/$',
         auth_views.PasswordResetView.as_view(
             email_template_name='registration/password_reset_email.txt'
         ),
         name='password_reset'),
-    url(r'^password/reset/complete/$',
+    re_path(r'^password/reset/complete/$',
         auth_views.PasswordResetCompleteView.as_view(),
         name='password_reset_complete'),
-    url(r'^password/reset/done/$',
+    re_path(r'^password/reset/done/$',
         auth_views.PasswordResetDoneView.as_view(),
         name='password_reset_done'),
-    url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/'
+    re_path(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/'
         r'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
         auth_views.PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
diff --git a/sweettooth/errorreports/models.py b/sweettooth/errorreports/models.py
index 01712cf..7066753 100644
--- a/sweettooth/errorreports/models.py
+++ b/sweettooth/errorreports/models.py
@@ -9,4 +9,5 @@ class ErrorReport(models.Model):
     user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="+")
     extension = models.ForeignKey(Extension, null=True, on_delete=models.CASCADE)
 
-error_reported = Signal(providing_args=["request", "version", "report"])
+# providing_args=["request", "version", "report"]
+error_reported = Signal()
diff --git a/sweettooth/errorreports/urls.py b/sweettooth/errorreports/urls.py
index 46fcb37..408d8ff 100644
--- a/sweettooth/errorreports/urls.py
+++ b/sweettooth/errorreports/urls.py
@@ -1,9 +1,9 @@
 
-from django.conf.urls import url
+from django.urls import re_path
 
 from sweettooth.errorreports import views
 
 urlpatterns = [
-    url(r'^report/(?P<pk>\d+)', views.report_error, name='report_error'),
-    url(r'^view/(?P<pk>\d+)', views.view_error_report),
+    re_path(r'^report/(?P<pk>\d+)', views.report_error, name='report_error'),
+    re_path(r'^view/(?P<pk>\d+)', views.view_error_report),
 ]
diff --git a/sweettooth/extensions/models.py b/sweettooth/extensions/models.py
index b050e23..c488ae4 100644
--- a/sweettooth/extensions/models.py
+++ b/sweettooth/extensions/models.py
@@ -472,6 +472,9 @@ class ExtensionVersion(models.Model):
     def is_inactive(self):
         return self.status == STATUS_INACTIVE
 
-submitted_for_review = Signal(providing_args=["request", "version"])
-reviewed = Signal(providing_args=["request", "version", "review"])
-extension_updated = Signal(providing_args=["extension"])
+# providing_args=["request", "version"]
+submitted_for_review = Signal()
+# providing_args=["request", "version", "review"]
+reviewed = Signal()
+# providing_args=["extension"]
+extension_updated = Signal()
diff --git a/sweettooth/extensions/urls.py b/sweettooth/extensions/urls.py
index e90b33a..3f65755 100644
--- a/sweettooth/extensions/urls.py
+++ b/sweettooth/extensions/urls.py
@@ -1,48 +1,49 @@
 
-from django.conf.urls import include, url
+from django.conf.urls import include
+from django.urls import re_path
 from django.views.generic.base import TemplateView
 
 from sweettooth.extensions import views, models, feeds
 
 ajax_patterns = [
-    url(r'^edit/(?P<pk>\d+)', views.ajax_inline_edit_view, name='extensions-ajax-inline'),
-    url(r'^upload/screenshot/(?P<pk>\d+)', views.ajax_upload_screenshot_view, 
name='extensions-ajax-screenshot'),
-    url(r'^upload/icon/(?P<pk>\d+)', views.ajax_upload_icon_view, name='extensions-ajax-icon'),
-    url(r'^detail/', views.ajax_details_view, name='extensions-ajax-details'),
+    re_path(r'^edit/(?P<pk>\d+)', views.ajax_inline_edit_view, name='extensions-ajax-inline'),
+    re_path(r'^upload/screenshot/(?P<pk>\d+)', views.ajax_upload_screenshot_view, 
name='extensions-ajax-screenshot'),
+    re_path(r'^upload/icon/(?P<pk>\d+)', views.ajax_upload_icon_view, name='extensions-ajax-icon'),
+    re_path(r'^detail/', views.ajax_details_view, name='extensions-ajax-details'),
 
-    url(r'^set-status/active/', views.ajax_set_status_view,
+    re_path(r'^set-status/active/', views.ajax_set_status_view,
         dict(newstatus=models.STATUS_ACTIVE), name='extensions-ajax-set-status-active'),
-    url(r'^set-status/inactive/', views.ajax_set_status_view,
+    re_path(r'^set-status/inactive/', views.ajax_set_status_view,
         dict(newstatus=models.STATUS_INACTIVE), name='extensions-ajax-set-status-inactive'),
-    url(r'^adjust-popularity/', views.ajax_adjust_popularity_view),
+    re_path(r'^adjust-popularity/', views.ajax_adjust_popularity_view),
 ]
 
 shell_patterns = [
-    url(r'^extension-query/', views.ajax_query_view, name='extensions-query'),
+    re_path(r'^extension-query/', views.ajax_query_view, name='extensions-query'),
 
-    url(r'^extension-info/', views.ajax_details_view),
+    re_path(r'^extension-info/', views.ajax_details_view),
 
-    url(r'^download-extension/(?P<uuid>.+)\.shell-extension\.zip$',
+    re_path(r'^download-extension/(?P<uuid>.+)\.shell-extension\.zip$',
         views.shell_download, name='extensions-shell-download'),
 
-    url(r'^update-info/', views.shell_update, name='extensions-shell-update'),
+    re_path(r'^update-info/', views.shell_update, name='extensions-shell-update'),
 ]
 
 urlpatterns = [
-    url(r'^$', TemplateView.as_view(template_name='extensions/list.html'), name='extensions-index'),
+    re_path(r'^$', TemplateView.as_view(template_name='extensions/list.html'), name='extensions-index'),
 
-    url(r'^about/$', TemplateView.as_view(template_name='extensions/about.html'), name='extensions-about'),
+    re_path(r'^about/$', TemplateView.as_view(template_name='extensions/about.html'), 
name='extensions-about'),
 
-    url(r'^extension/(?P<pk>\d+)/(?P<slug>.+)/$',
+    re_path(r'^extension/(?P<pk>\d+)/(?P<slug>.+)/$',
         views.extension_view, name='extensions-detail'),
-    url(r'^extension/(?P<pk>\d+)/$',
+    re_path(r'^extension/(?P<pk>\d+)/$',
         views.extension_view, dict(slug=None), name='extensions-detail'),
 
-    url(r'^local/', TemplateView.as_view(template_name='extensions/local.html'), name='extensions-local'),
+    re_path(r'^local/', TemplateView.as_view(template_name='extensions/local.html'), 
name='extensions-local'),
 
-    url(r'^rss/', feeds.LatestExtensionsFeed(), name='extensions-rss-feed'),
+    re_path(r'^rss/', feeds.LatestExtensionsFeed(), name='extensions-rss-feed'),
 
-    url(r'^upload/', views.upload_file, name='extensions-upload-file'),
-    url(r'^ajax/', include(ajax_patterns)),
-    url(r'', include(shell_patterns)),
+    re_path(r'^upload/', views.upload_file, name='extensions-upload-file'),
+    re_path(r'^ajax/', include(ajax_patterns)),
+    re_path(r'', include(shell_patterns)),
 ]
diff --git a/sweettooth/ratings/admin.py b/sweettooth/ratings/admin.py
index ac0ccc4..29d5b1b 100644
--- a/sweettooth/ratings/admin.py
+++ b/sweettooth/ratings/admin.py
@@ -1,7 +1,7 @@
 
 from django.contrib import admin
 from django_comments.admin import CommentsAdmin
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 from sweettooth.ratings.models import RatingComment
 
diff --git a/sweettooth/ratings/urls.py b/sweettooth/ratings/urls.py
index 469fb97..f69af79 100644
--- a/sweettooth/ratings/urls.py
+++ b/sweettooth/ratings/urls.py
@@ -1,8 +1,8 @@
 
-from django.conf.urls import include, url
+from django.urls import re_path
 from sweettooth.ratings import views
 
 urlpatterns = [
-    url(r'^posted/$', views.comment_done, name='comments-comment-done'),
-    url(r'^all/$', views.get_comments),
+    re_path(r'^posted/$', views.comment_done, name='comments-comment-done'),
+    re_path(r'^all/$', views.get_comments),
 ]
diff --git a/sweettooth/review/urls.py b/sweettooth/review/urls.py
index 23cdb63..d01c0da 100644
--- a/sweettooth/review/urls.py
+++ b/sweettooth/review/urls.py
@@ -1,22 +1,22 @@
 
-from django.conf.urls import url
+from django.urls import re_path
 from django.views.generic.list import ListView
 
 from sweettooth.extensions.models import ExtensionVersion
 from sweettooth.review import views
 
 urlpatterns = [
-    url(r'^$', ListView.as_view(template_name='review/list.html',
+    re_path(r'^$', ListView.as_view(template_name='review/list.html',
                                 queryset=ExtensionVersion.objects.unreviewed(),
                                 context_object_name='version_list'),
         name='review-list'),
-    url(r'^ajax/get-file/(?P<pk>\d+)', views.ajax_get_file_view, name='review-ajax-files'),
-    url(r'^ajax/get-file-list/(?P<pk>\d+)', views.ajax_get_file_list_view, name='review-ajax-file-list'),
-    url(r'^ajax/get-file-diff/(?P<pk>\d+)', views.ajax_get_file_diff_view, name='review-ajax-file-diff'),
-    url(r'^submit/(?P<pk>\d+)', views.submit_review_view, name='review-submit'),
+    re_path(r'^ajax/get-file/(?P<pk>\d+)', views.ajax_get_file_view, name='review-ajax-files'),
+    re_path(r'^ajax/get-file-list/(?P<pk>\d+)', views.ajax_get_file_list_view, name='review-ajax-file-list'),
+    re_path(r'^ajax/get-file-diff/(?P<pk>\d+)', views.ajax_get_file_diff_view, name='review-ajax-file-diff'),
+    re_path(r'^submit/(?P<pk>\d+)', views.submit_review_view, name='review-submit'),
 
-    url(r'^download/(?P<pk>\d+)\.shell-extension.zip$',
+    re_path(r'^download/(?P<pk>\d+)\.shell-extension.zip$',
         views.download_zipfile, name='review-download'),
 
-    url(r'^(?P<pk>\d+)', views.review_version_view, name='review-version'),
+    re_path(r'^(?P<pk>\d+)', views.review_version_view, name='review-version'),
 ]
diff --git a/sweettooth/urls.py b/sweettooth/urls.py
index d1d3b1e..d106ba2 100644
--- a/sweettooth/urls.py
+++ b/sweettooth/urls.py
@@ -1,11 +1,12 @@
 
 import os.path
 
-from django.conf.urls import include, url, handler404, handler500
+from django.conf.urls import include
 from django.conf import settings
 from django.http import HttpResponse
 
 from django.contrib import admin
+from django.urls import re_path
 from django.views import static
 from django.views.generic.base import TemplateView
 from django.views.i18n import JavaScriptCatalog
@@ -14,24 +15,24 @@ admin.autodiscover()
 
 urlpatterns = [
     # 'login' and 'register'
-    url(r'^accounts/', include('sweettooth.auth.urls')),
-    url(r'^', include('sweettooth.extensions.urls'), name='index'),
+    re_path(r'^accounts/', include('sweettooth.auth.urls')),
+    re_path(r'^', include('sweettooth.extensions.urls'), name='index'),
 
-    url(r'^review/', include('sweettooth.review.urls')),
-    url(r'^errors/', include('sweettooth.errorreports.urls')),
+    re_path(r'^review/', include('sweettooth.review.urls')),
+    re_path(r'^errors/', include('sweettooth.errorreports.urls')),
 
-    url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
-    url(r'^admin/', admin.site.urls),
-    url(r'^comments/', include('sweettooth.ratings.urls')),
-    url(r'^comments/', include('django_comments.urls')),
-    url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
+    re_path(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
+    re_path(r'^admin/', admin.site.urls),
+    re_path(r'^comments/', include('sweettooth.ratings.urls')),
+    re_path(r'^comments/', include('django_comments.urls')),
+    re_path(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
 ]
 
 if settings.DEBUG:
     # Use static.serve for development...
-    urlpatterns.append(url(r'^extension-data/(?P<path>.*)', static.serve,
+    urlpatterns.append(re_path(r'^extension-data/(?P<path>.*)', static.serve,
                            dict(document_root=settings.MEDIA_ROOT), name='extension-data'))
 else:
     # and a dummy to reverse on for production.
-    urlpatterns.append(url(r'^extension-data/(?P<path>.*)', lambda *a, **kw: HttpResponse(),
+    urlpatterns.append(re_path(r'^extension-data/(?P<path>.*)', lambda *a, **kw: HttpResponse(),
                            name='extension-data'))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]