-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bat
45 lines (35 loc) · 1.14 KB
/
setup.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
@echo off
rem Nastav kódovanie na UTF-8
chcp 65001
title Inicializácia
SET ENV_NAME=sutazestrom-env
rem Choď do priečinka v ktorom je skript
cd %~dp0
rem Vytvor a aktivuj prostredie pre python
py -m venv %ENV_NAME%
call %ENV_NAME%\Scripts\activate.bat
rem Nainštaluj balíky
pip install -r requirements.txt
rem Inicializuj Django
python manage.py makemigrations --noinput
python manage.py migrate --noinput
python manage.py collectstatic --noinput
python manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '', 'gumibanan')"
rem Deaktivuj prostredie pre python
call %ENV_NAME%\Scripts\deactivate.bat
rem Vytvor skript na spustenie serveru
echo @echo off> run.bat
echo.>> run.bat
echo chcp 65001>> run.bat
echo.>> run.bat
echo cd %%^~dp0>> run.bat
echo.>> run.bat
echo title Odovzdávač>> run.bat
echo.>> run.bat
echo call %ENV_NAME%\Scripts\activate.bat>> run.bat
echo.>> run.bat
echo start "Odovzdávač" python manage.py runserver 0.0.0.0:8000>> run.bat
echo.>> run.bat
echo call %ENV_NAME%\Scripts\deactivate.bat>> run.bat
rem Spusti server
call run.bat