From f544a40229fd7134622c3a60cf99b340d8b8b61a Mon Sep 17 00:00:00 2001 From: AGentooCat Date: Sat, 18 Mar 2023 17:25:20 +0000 Subject: [PATCH] fix virtualenv setup --- README.md | 8 +++++++- etc/project.vars | 7 ++++++- setup_venv.sh | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a912fbb6..cb74dde3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ To run locally (for testing purposes): -- Install proxychains, configure it for Tor +- Install virtualenv and Python 2.7 + +- (Optional) Install proxychains, configure it for Tor - Pull in the dependencies: @@ -21,9 +23,13 @@ To run locally (for testing purposes): - Start the webserver: ``` + $ source env/bin/activate # activates virtualenv $ ./runserver.py + $ deactivate # ..s virtualenv ``` + (if the shell in use is not bash, you can append its name to the activator if supported: `...ivate.fish`) + - Open the site at http://localhost:5000/ ## Running a mirror diff --git a/etc/project.vars b/etc/project.vars index da768a33..b8c3ff77 100644 --- a/etc/project.vars +++ b/etc/project.vars @@ -1,2 +1,7 @@ export venv_dir="env" -export venv="`which virtualenv-2.7 || which virtualenv`" +export spec="" +export venv="`which virtualenv-2.7`" +if [ x"$venv" = x ]; then + export venv="`which virtualenv`" + export spec="-p 2.7" +fi diff --git a/setup_venv.sh b/setup_venv.sh index 9b3b3a40..425e3bf8 100755 --- a/setup_venv.sh +++ b/setup_venv.sh @@ -7,7 +7,7 @@ if [ ! $venv ]; then exit 1 else if [ ! -d $venv_dir ] ; then - $venv --distribute $venv_dir + $venv $spec $venv_dir fi . $venv_dir/bin/activate