From 0cd4b97b68160546e95c6e4aaa792ba7c5bd609d Mon Sep 17 00:00:00 2001
From: Magnus Hagander <magnus@hagander.net>
Date: Sun, 25 Feb 2018 14:39:05 +0100
Subject: [PATCH] Update URL configurations for newer django

---
 hamnadmin/hamnadmin/register/urls.py | 41 +++++++++++++++-------------
 hamnadmin/hamnadmin/urls.py          | 20 ++++++--------
 2 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/hamnadmin/hamnadmin/register/urls.py b/hamnadmin/hamnadmin/register/urls.py
index 08232ca..a4a6968 100644
--- a/hamnadmin/hamnadmin/register/urls.py
+++ b/hamnadmin/hamnadmin/register/urls.py
@@ -1,27 +1,30 @@
-from django.conf.urls import *
+from django.conf.urls import url, include
+
+import hamnadmin.register.views
+import hamnadmin.auth
 
 # Uncomment the next two lines to enable the admin:
 from django.contrib import admin
 admin.autodiscover()
 
-urlpatterns = patterns('',
-    (r'^$', 'hamnadmin.register.views.root'),
-    (r'^new/$', 'hamnadmin.register.views.edit'),
-    (r'^edit/(?P<id>\d+)/$', 'hamnadmin.register.views.edit'),
-    (r'^delete/(?P<id>\d+)/$', 'hamnadmin.register.views.delete'),
-    (r'^archive/(?P<id>\d+)/$', 'hamnadmin.register.views.archive'),
-    (r'^teamremove/(?P<teamid>\d+)/(?P<blogid>\d+)/$', 'hamnadmin.register.views.remove_from_team'),
+urlpatterns = [
+    url(r'^$', hamnadmin.register.views.root),
+    url(r'^new/$', hamnadmin.register.views.edit),
+    url(r'^edit/(?P<id>\d+)/$', hamnadmin.register.views.edit),
+    url(r'^delete/(?P<id>\d+)/$', hamnadmin.register.views.delete),
+    url(r'^archive/(?P<id>\d+)/$', hamnadmin.register.views.archive),
+    url(r'^teamremove/(?P<teamid>\d+)/(?P<blogid>\d+)/$', hamnadmin.register.views.remove_from_team),
 
-    (r'^blogposts/(\d+)/hide/(\d+)/$', 'hamnadmin.register.views.blogpost_hide'),
-    (r'^blogposts/(\d+)/unhide/(\d+)/$', 'hamnadmin.register.views.blogpost_unhide'),
-    (r'^blogposts/(\d+)/delete/(\d+)/$', 'hamnadmin.register.views.blogpost_delete'),
+    url(r'^blogposts/(\d+)/hide/(\d+)/$', hamnadmin.register.views.blogpost_hide),
+    url(r'^blogposts/(\d+)/unhide/(\d+)/$', hamnadmin.register.views.blogpost_unhide),
+    url(r'^blogposts/(\d+)/delete/(\d+)/$', hamnadmin.register.views.blogpost_delete),
 
-    (r'^moderate/$', 'hamnadmin.register.views.moderate'),
-    (r'^moderate/reject/(\d+)/$', 'hamnadmin.register.views.moderate_reject'),
-    (r'^moderate/approve/(\d+)/$', 'hamnadmin.register.views.moderate_approve'),
-    (r'^login/$', 'hamnadmin.auth.login'),
-    (r'^auth_receive/$', 'hamnadmin.auth.auth_receive'),
-    (r'^logout/$', 'hamnadmin.auth.logout'),
+    url(r'^moderate/$', hamnadmin.register.views.moderate),
+    url(r'^moderate/reject/(\d+)/$', hamnadmin.register.views.moderate_reject),
+    url(r'^moderate/approve/(\d+)/$', hamnadmin.register.views.moderate_approve),
+    url(r'^login/$', hamnadmin.auth.login),
+    url(r'^auth_receive/$', hamnadmin.auth.auth_receive),
+    url(r'^logout/$', hamnadmin.auth.logout),
 
-    (r'^admin/', include(admin.site.urls)),
-)
+    url(r'^admin/', include(admin.site.urls)),
+]
diff --git a/hamnadmin/hamnadmin/urls.py b/hamnadmin/hamnadmin/urls.py
index 2bd0ff9..4a0bc2d 100644
--- a/hamnadmin/hamnadmin/urls.py
+++ b/hamnadmin/hamnadmin/urls.py
@@ -1,15 +1,13 @@
-from django.conf.urls import *
+from django.conf.urls import url, include
 
-# Uncomment the next two lines to enable the admin:
-# from django.contrib import admin
-# admin.autodiscover()
+import hamnadmin.register.views
 from hamnadmin.register.feeds import PostFeed
 
-urlpatterns = patterns('',
-    (r'^$', 'hamnadmin.register.views.planet_home'),
-    (r'^add.html$', 'hamnadmin.register.views.planet_add'),
-    (r'^feeds.html$', 'hamnadmin.register.views.planet_feeds'),
+urlpatterns = [
+    url(r'^$', hamnadmin.register.views.planet_home),
+    url(r'^add.html$', hamnadmin.register.views.planet_add),
+    url(r'^feeds.html$', hamnadmin.register.views.planet_feeds),
 
-    (r'^rss20(?P<type>_short)?\.xml$', PostFeed()),
-    (r'^register/', include('hamnadmin.register.urls')),
-)
+    url(r'^rss20(?P<type>_short)?\.xml$', PostFeed()),
+    url(r'^register/', include('hamnadmin.register.urls')),
+]
-- 
2.39.5

