From 685594a6c091bb1a5175d61c7e3196726968084a Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Mon, 9 Jan 2023 13:11:25 +0100
Subject: [PATCH] Upgrade to Django 3.2

---
 VIPSWeb/local_settings_sample.py | 14 +++++++-------
 VIPSWeb/settings.py              |  3 +++
 requirements.txt                 |  7 ++++---
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/VIPSWeb/local_settings_sample.py b/VIPSWeb/local_settings_sample.py
index 1e188004..33cfd8ad 100755
--- a/VIPSWeb/local_settings_sample.py
+++ b/VIPSWeb/local_settings_sample.py
@@ -92,13 +92,13 @@ DATABASES = {
 }
 
 # Caching with memcached
-#CACHES = {
-#    'default': {
-#        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
-#        'LOCATION': 'unix:/tmp/memcached.sock',
-#        'LOCATION': '127.0.0.1:11211',
-#    }
-#}
+# https://docs.djangoproject.com/en/3.2/topics/cache/
+CACHES = {
+    'default': {
+        'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache',
+        'LOCATION': '127.0.0.1:11211',
+    }
+}
 
 # Site name - appears in header of all pages. HTML is allowed
 SITE_NAME = "Example site title"
diff --git a/VIPSWeb/settings.py b/VIPSWeb/settings.py
index ed6c09f7..dfb0c451 100755
--- a/VIPSWeb/settings.py
+++ b/VIPSWeb/settings.py
@@ -31,6 +31,9 @@ LOCALE_PATHS = (
     os.path.join(SITE_ROOT, 'locale'),
 )
 
+# New in Django 3.2
+# https://docs.djangoproject.com/en/4.1/releases/3.2/#what-s-new-in-django-3-2
+DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
 
 SITE_ID = 1
 
diff --git a/requirements.txt b/requirements.txt
index daa73cc5..99a24132 100755
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016 NIBIO <http://www.nibio.no/>. 
+# Copyright (c) 2023 NIBIO <http://www.nibio.no/>. 
 # 
 # This file is part of VIPSWeb.
 # VIPSWeb is free software: you can redistribute it and/or modify
@@ -18,11 +18,12 @@
 
 # Please add requirements here
 # Read docs for how this works: http://www.pip-installer.org/en/latest/cookbook.html
-Django==3.1.3
+Django==3.2.16
 Pillow
 requests==2.25.0
 django-tinymce==2.8.0
 python-dateutil==2.8.1
 django-extensions
 selenium
-python-memcached
+#python-memcached
+pymemcache
-- 
GitLab