From 283e41ac48a7db8e5bd5fd69db0a222674d30a02 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Tue, 21 May 2019 15:02:01 +0100 Subject: [PATCH 1/6] Update Django version in requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e2bfd15..0b19d68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dirq -django==1.6.3 +django==1.11.20 djangorestframework==3.0.5 python-jose<3.0.0 MySQL-python From 0cdcc9446591d1b74a0a9efecb18fa2ff9fb5301 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 30 May 2019 17:47:00 +0100 Subject: [PATCH 2/6] Remove use of deprecated patterns() --- apel_rest/urls.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/apel_rest/urls.py b/apel_rest/urls.py index 5f31ccd..b249c30 100644 --- a/apel_rest/urls.py +++ b/apel_rest/urls.py @@ -1,24 +1,25 @@ """This file maps url patterns to classes.""" -from django.conf.urls import patterns, include, url +from django.conf.urls import include, url from django.contrib import admin from api.views.CloudRecordSummaryView import CloudRecordSummaryView from api.views.CloudRecordView import CloudRecordView + admin.autodiscover() -urlpatterns = patterns('', - # Examples: - # url(r'^$', 'apel_rest.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), +urlpatterns = [ + # Examples: + # url(r'^$', 'apel_rest.views.home', name='home'), + # url(r'^blog/', include('blog.urls')), - url(r'^admin/', - include(admin.site.urls)), + url(r'^admin/', include(admin.site.urls)), - url(r'^api/v1/cloud/record$', - CloudRecordView.as_view(), - name='CloudRecordView'), + url(r'^api/v1/cloud/record$', + CloudRecordView.as_view(), + name='CloudRecordView'), - url(r'^api/v1/cloud/record/summary$', - CloudRecordSummaryView.as_view(), - name='CloudRecordSummaryView')) + url(r'^api/v1/cloud/record/summary$', + CloudRecordSummaryView.as_view(), + name='CloudRecordSummaryView') +] From 3b8a0c2f591cc5dca932024739cc0c8bb945b29a Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 30 May 2019 17:53:28 +0100 Subject: [PATCH 3/6] Update rest framework version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0b19d68..95177e1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ dirq django==1.11.20 -djangorestframework==3.0.5 +djangorestframework==3.9.4 python-jose<3.0.0 MySQL-python From aa56be821833ad5103291787d5c1847b689ae5dd Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 30 May 2019 17:57:47 +0100 Subject: [PATCH 4/6] Remove Python 2.6 Travis build --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 05a6ea9..336d133 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "2.6" - "2.7" - "nightly" matrix: From 48f572e5b8b578ab4c701ef10b042cf6623029b0 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 30 May 2019 17:59:23 +0100 Subject: [PATCH 5/6] Add Py3 compatible config parser import --- api/views/CloudRecordSummaryView.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/views/CloudRecordSummaryView.py b/api/views/CloudRecordSummaryView.py index 22f0826..52d3fa4 100644 --- a/api/views/CloudRecordSummaryView.py +++ b/api/views/CloudRecordSummaryView.py @@ -1,6 +1,9 @@ """This file contains the CloudRecordSummaryView class.""" -import ConfigParser +try: + import ConfigParser +except ImportError: + import configparser as ConfigParser import datetime import logging import MySQLdb From 5121adad6f98db00f647747584d2392fe1f949fc Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 30 May 2019 18:07:52 +0100 Subject: [PATCH 6/6] Replace MySQL-python with Py3 compatible module --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 95177e1..b91377b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ dirq django==1.11.20 djangorestframework==3.9.4 python-jose<3.0.0 -MySQL-python +mysqlclient==1.3.4