cdc-placement-website-backend/setup.sh

31 lines
772 B
Bash
Raw Normal View History

python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt
echo "Environment setup complete"
cd CDC_Backend
python3 manage.py flush --no-input
python3 manage.py makemigrations
python3 manage.py migrate
echo "Migrations complete"
python3 manage.py collectstatic --noinput
DIR="./Storage"
if [ -d "$DIR" ]; then
### Take action if $DIR exists ###
echo "${DIR} Directory already exists"
else
### Control will jump here if $DIR does NOT exists ###
echo "Creating ${DIR} Directory..."
mkdir ${DIR}
echo "${DIR} Directory Created"
fi
2022-05-28 23:07:38 +05:30
echo Do you want ceate credentials for super user (Y/N) ?
read create
create=${create^^}
if [ "$create" == "Y" ]; then
### Take action if user want to create ###
python3 manage.py createsuperuser
fi