forked from 101t/jasmin-web-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_data_win.bat
34 lines (30 loc) · 923 Bytes
/
load_data_win.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
set ENVIROO=python
set MANAGER=manage.py
CALL env\Scripts\activate
set init_result=F
if "%~1"=="--init" set init_result=T
if "%~1"=="-i" set init_result=T
if "%init_result%"=="T" (
echo - Deleting sqlite database if exist ...
del /F db.sqlite3
echo - Reset all migrations files ...
%ENVIROO% %MANAGER% reseter
echo - Make new migrations files ...
%ENVIROO% %MANAGER% makemigrations core
%ENVIROO% %MANAGER% makemigrations users
%ENVIROO% %MANAGER% makemigrations notify
%ENVIROO% %MANAGER% makemigrations
echo - Migrate database ...
%ENVIROO% %MANAGER% migrate
echo - Loading new data samples ...
%ENVIROO% %MANAGER% load_new
)
set start_result=F
if "%~2"=="--start" set start_result=T
if "%~2"=="-s" set start_result=T
if "%start_result%"=="T" (
set RUN_PROJECT=%ENVIROO% %MANAGER% runserver 0.0.0.0:8000
echo %RUN_PROJECT%
CALL %RUN_PROJECT%
)