From 87fe056e56b5947bafbdc4fb3f798661044f011c Mon Sep 17 00:00:00 2001 From: j Date: Thu, 16 Mar 2017 12:37:29 +0100 Subject: [PATCH] use python3 from venv if manage.py gets started with 2 --- pandora/manage.py | 6 ++++++ vm/LXC_README.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/pandora/manage.py b/pandora/manage.py index 529afbda..762bfa57 100755 --- a/pandora/manage.py +++ b/pandora/manage.py @@ -5,6 +5,12 @@ import sys root_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__))) os.chdir(root_dir) +python3 = os.path.normpath(os.path.join(root_dir, '..', 'bin', 'python3')) +if os.path.exists(python3) and sys.version_info[0] == 2 and sys.argv[0].endswith('manage.py'): + import subprocess + cmd = [python3] + sys.argv + sys.exit(subprocess.call(cmd)) + # using virtualenv's activate_this.py to reorder sys.path activate_this = os.path.join(root_dir, '..', 'bin', 'activate_this.py') with open(activate_this) as f: diff --git a/vm/LXC_README.txt b/vm/LXC_README.txt index f00aea8a..bcb0f1bf 100644 --- a/vm/LXC_README.txt +++ b/vm/LXC_README.txt @@ -22,6 +22,7 @@ echo "pandora:pandora" | chpasswd echo PasswordAuthentication no >> /etc/ssh/sshd_config locale-gen en_US.UTF-8 + export LANG=en_US.UTF-8 cd /root curl -L https://pan.do/ra-install > pandora_install.sh