From a57aeff9385da173dbea6a16ee8e880c432f4455 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 8 Mar 2024 12:46:37 +0100 Subject: [PATCH] Address Django Deprecations for 4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit django.utils.translation.ugettext_lazy() is deprecated in favor of the functions that they’re aliases for: django.utils.translationgettext_lazy() With that MemcachedCache backend was also deprecated in favor of PyMemcacheCache. MemcachedCache was removed in django 4.1 https: //docs.djangoproject.com/en/4.0/releases/3.0/#id3 Change-Id: I9b77b33fbc4a9560c72504f935bf7f9082fefdd7 --- defaults/main.yml | 2 +- templates/horizon_local_settings.py.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3bb22b89..8b80ff28 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -146,7 +146,7 @@ horizon_service_name: horizon horizon_session_engine: 'django.contrib.sessions.backends.cache' horizon_session_caches: default: - BACKEND: 'django.core.cache.backends.memcached.MemcachedCache' + BACKEND: 'django.core.cache.backends.memcached.PyMemcacheCache' LOCATION: "{{ horizon_memcached_servers.split(',') }}" horizon_session_timeout: 1800 diff --git a/templates/horizon_local_settings.py.j2 b/templates/horizon_local_settings.py.j2 index cf3f4cdc..904f1264 100644 --- a/templates/horizon_local_settings.py.j2 +++ b/templates/horizon_local_settings.py.j2 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon.utils import secret_key