Merge pull request #120 from CDC-IITDH/setup-files

Add files via upload
This commit is contained in:
karthik mv 2023-05-30 15:09:24 +05:30 committed by GitHub
commit 4bfdba5dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 0 deletions

15
setup.bat Normal file
View File

@ -0,0 +1,15 @@
start /wait python -m venv venv && venv\Scripts\activate && pip install -r requirements.txt &^
echo Environment Setup Complete &^
timeout 3 > NUL &^
echo enter password for user postgres &^
createdb -h localhost -p 5432 -U postgres cdc &^
cd "CDC_Backend" &^
python manage.py flush --no-input &^
python manage.py makemigrations &^
python manage.py migrate &^
echo Migrations complete &^
cd .. &^
start .\superuser.bat &^
echo done successfully

View File

@ -20,3 +20,11 @@ else
echo "${DIR} Directory Created" echo "${DIR} Directory Created"
fi fi
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

12
superuser.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
set /p create="do you want to create supruser ? (Y/N) "
cd "CDC_Backend" &^
if %create% equ Y ( python manage.py createsuperuser )
if %create% equ y ( python manage.py createsuperuser )
python manage.py collectstatic --noinput
if exist Storage (echo Storage Directory already exists) else ( echo Creating Storage Directory... & mkdir Storage & echo Storage Directory Created)
timeout 3 > NUL
pause