-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·35 lines (30 loc) · 977 Bytes
/
setup.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
#! /bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
if source ./env/bin/activate; then
echo -e "$RED Virtualenv Found. Using pre existing env. $NC"
else
echo -e "$RED Virtualenv Not Found. Creating new env. $NC"
virtualenv -p python3 env
source env/bin/activate
fi
echo -e "$RED Installing requirements. $NC"
pip install -r requirements.txt
setup_folder=$PWD
echo -e "$RED Setup folder path is: $NC $setup_folder"
# add absolute path to the wrappers
echo -e "$RED Webserver Setup started.$NC"
# WEBSERVER SETUP
cd crossval
echo -e "$RED Removing old Database if any.$NC"
rm db.sqlite3
echo -e "$RED Creating new database structures.$NC"
python manage.py makemigrations
echo -e "$RED Creating new database.$NC"
python manage.py migrate
echo -e "$RED Collecting static files.$NC"
mkdir crossval/static_serve
python manage.py collectstatic --noinput
echo -e "$RED Set up a superuser. $NC"
python manage.py createsuperuser
echo -e "$RED Setup is done. $NC"