add support for ubuntu 24
This commit is contained in:
parent
103b930957
commit
cb31db90f7
|
|
@ -10,6 +10,25 @@ For the full list of settings and their values, see
|
|||
https://docs.djangoproject.com/en/1.11/ref/settings/
|
||||
"""
|
||||
|
||||
# Fix for botocore.vendored.six.moves import error
|
||||
import sys
|
||||
try:
|
||||
import six
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
# Create a compatibility shim for botocore.vendored
|
||||
if 'botocore' not in sys.modules:
|
||||
import botocore
|
||||
if not hasattr(sys.modules.get('botocore', None), 'vendored'):
|
||||
import types
|
||||
vendored = types.ModuleType('vendored')
|
||||
vendored.six = six
|
||||
sys.modules['botocore'].vendored = vendored
|
||||
sys.modules['botocore.vendored'] = vendored
|
||||
sys.modules['botocore.vendored.six'] = six
|
||||
sys.modules['botocore.vendored.six.moves'] = six.moves
|
||||
|
||||
import os
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
|
|
|||
|
|
@ -720,6 +720,17 @@ password="%s"
|
|||
|
||||
os.chdir("/usr/local/CyberCP")
|
||||
|
||||
# Clear Python cache to avoid botocore vendored six import errors
|
||||
command = "find /usr/local/CyberCP -name '*.pyc' -delete"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = "find /usr/local/CyberCP -name '__pycache__' -type d -exec rm -rf {} +"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
# Ensure six module is installed to fix botocore compatibility
|
||||
command = "/usr/local/CyberPanel/bin/python -m pip install six==1.16.0"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||
|
||||
command = "/usr/local/CyberPanel/bin/python manage.py makemigrations"
|
||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ cloudflare==2.20.0
|
|||
cryptography==43.0.0
|
||||
cffi
|
||||
Django==4.2.14
|
||||
six==1.16.0
|
||||
docker==7.1.0
|
||||
google-api-core==2.19.1
|
||||
google-api-python-client==2.139.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue