From c03c4c79b7f6d9c2ec26f5a2e59f3456461e8fef Mon Sep 17 00:00:00 2001 From: Attila-Mihaly Balazs Date: Sat, 2 Jun 2012 23:14:16 +0300 Subject: [PATCH] First stab at a script to install virtualenv --- install_venv | 10 ++++++++++ osqa.wsgi.dist | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100755 install_venv diff --git a/install_venv b/install_venv new file mode 100755 index 00000000..b22bf5ea --- /dev/null +++ b/install_venv @@ -0,0 +1,10 @@ +#!/bin/bash +set -ue +if [[ -n "$( pwd | grep -o -P ' ' )" ]]; then + echo "Warning! Working directory contains spaces, virtualenv might have problems with it!" +fi +if [ ! -d venv ]; then + virtualenv --verbose venv +fi +./venv/bin/easy_install markdown html5lib python-openid South psycopg2 mysql-python python-memcached django==1.3.1 django-debug-toolbar django-endless-pagination +echo "Virtualenv installed to ./venv" diff --git a/osqa.wsgi.dist b/osqa.wsgi.dist index 70c0da87..18bfa047 100644 --- a/osqa.wsgi.dist +++ b/osqa.wsgi.dist @@ -1,3 +1,11 @@ +import os.path +file_path = os.path.dirname(os.path.abspath(__file__)) +one_level_up = os.path.dirname(file_path) +file_dir = os.path.basename(file_path) +activate_this = os.path.join(file_path, 'venv', 'bin', 'activate_this.py') +if os.path.isfile(activate_this): + execfile(activate_this, dict(__file__=activate_this)) + import os import sys sys.path.append('/path/to_dir_above')