-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.bat
56 lines (42 loc) · 1.12 KB
/
start.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@echo off
echo Starting up project...
pushd "%~dp0" > NUL
set BASE_DIR=%~dp0
popd > NUL
echo.BASE_DIR : %BASE_DIR%
::--------------------------------------------------------
:: Main
::--------------------------------------------------------
call cd %BASE_DIR%
set OPT_ENV_FORCE=%1
echo.OPT_ENV_FORCE : %OPT_ENV_FORCE%
if "%OPT_ENV_FORCE%x" == "-fx" (
python "%BASE_DIR%manage.py" "clean"
)
python "%BASE_DIR%manage.py" "prepare"
call :build_venv
call :launch_webapp
echo.&pause&goto:eof
::--------------------------------------------------------
::-- Function definition starts below here
::--------------------------------------------------------
:logging
echo "[INFO] %*"
goto :eof
:build_venv
if not exist env (
virtualenv env
)
call env\Scripts\activate
call pip install -r requirements.txt
exit /b
:launch_webapp
del "%BASE_DIR%mysite\data\db.sqlite3"
del "%BASE_DIR%mysite\account\migrations\0*"
call python "%BASE_DIR%mysite\manage.py" "makemigrations" "account"
call python "%BASE_DIR%mysite\manage.py" "migrate"
call python "%BASE_DIR%mysite\initdb.py"
cd %BASE_DIR%mysite
call python "manage.py" "runserver"
exit /b
PAUSE