-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.bat
34 lines (30 loc) · 1.07 KB
/
run.bat
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
@ECHO off
:STEP1
REM Step 1 - Install npm packages
REM Needs node and npm to be pre-installed
cd core\ezybaas\static
echo %CD%
CALL npm install && ECHO "Installed NPM Packages" || ECHO "Failed installing packages"
GOTO STEP2
:STEP2
REM Step 2 - Setup Django Dependencies
REM Needs pip and virtualenv to be pre-installed.
cd ..
cd ..
echo %CD%
ECHO "Create or Reuse venv"
IF NOT EXIST "venv" (
virtualenv venv
)
CALL venv\Scripts\activate
pip install -r requirements.txt
REM Step 3 - Create default database (Sqlite)
REM Needs pip and virtualenv to be pre-installed.
python manage.py makemigrations
python manage.py migrate
REM Step 4 - Create superuser for login to ezybaas
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.filter(username='admin').exists() or User.objects.create_superuser('admin', 'admin@ezybaas.com', 'admin')" | python manage.py shell
REM python manage.py createsuperuser --noinput --username admin --email admin@ezybaas.com
REM Step 5 - Run D
REM Run Django on localhost:8000 (default)
python manage.py runserver