-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmac-create-virtualenv.sh
executable file
·52 lines (40 loc) · 1.15 KB
/
mac-create-virtualenv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
new_install=false
if [ ! -d "env" ]; then
#
# Check if Homebrew is installed
#
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
# https://github.com/mxcl/homebrew/wiki/installation
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
else
brew update
fi
which -s mysql || brew install mysql
which -s python || brew install python --with-brewed-openssl
which -s virtualenv || pip install virtualenv
#Setting up virtualenv
if [ ! -d "env" ]; then
mkdir "env"
fi
virtualenv --no-site-packages "env"
source "env/bin/activate"
#
# Install application requirements
#
pip install -r requirements.txt || { echo ' === localrun failed. pip could not installed the required files. === ' ; exit 1; }
else
source "env/bin/activate"
fi
if [ ! -f "project/database.sqlite3" ]; then
new_install=true
fi
( cd project ; python manage.py syncdb --noinput);
( cd project ; python manage.py migrate);
if $new_install ; then
echo ' ==== First Time Setup - Create an Administration Account ==== ';
( cd project ; python manage.py createsuperuser );
fi
( cd project ; python manage.py runserver );