forked from founders4schools/django-scarface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.command
executable file
·65 lines (50 loc) · 1.85 KB
/
start.command
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
53
54
55
56
57
58
59
60
61
62
63
64
65
#! /bin/sh
clear
echo "Launching..."
cd "`dirname "$0"`"
ls -a
export LANG="de_CH.UTF-8"
export LC_COLLATE="de_CH.UTF-8"
export LC_CTYPE="de_CH.UTF-8"
export LC_MESSAGES="de_CH.UTF-8"
export LC_MONETARY="de_CH.UTF-8"
export LC_NUMERIC="de_CH.UTF-8"
export LC_TIME="de_CH.UTF-8"
export LC_ALL=
echo "Checking Computer for all necessary tools...please make sure you have installed Xcode and the Command Line Utilities."
echo "Looking for brew..."
hash brew 2>/dev/null || { ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)";}
echo "Looking for python..."
hash python 2>/dev/null || { brew install python; }
echo "Looking for pip..."
hash pip 2>/dev/null || { sudo easy_install pip; }
echo "Looking for virtualenv..."
hash virtualenv 2>/dev/null || { sudo easy_install virtualenv; }
echo "Looking for virtualenvwrapper..."
hash mkvirtualenv 2>/dev/null || { sudo easy_install virtualenvwrapper; }
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Documents/Repositories
source virtualenvwrapper.sh
echo "First run - would you like to setup the environment? (y/n)"
read -n 1 name;
if [ "$name" == "y" ]; then
echo "Setting up a virtual environment for the current application..."
rmvirtualenv venv-django_scarface
mkvirtualenv venv-django_scarface
fi
workon venv-django_scarface
echo "Upgrading requirements..."
for line in $(cat requirements.txt)
do
pip install $line;
done
echo "Migrating database..."
if [ "$name" == "y" ]; then
echo "running fake migrations"
python manage.py syncdb --all --settings=django_scarface.settings.moku
python manage.py migrate --fake --settings=django_scarface.settings.moku
fi
python manage.py syncdb --settings=django_scarface.settings.moku
python manage.py migrate --settings=django_scarface.settings.moku
echo "Launching server..."
python manage.py runserver 0.0.0.0:8000 --settings=django_scarface.settings.moku