-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (56 loc) · 2.69 KB
/
Makefile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
## Makefie for mingw on windows (so mixed windows / bash commands)
create_venv: requirements.txt
test -d venv || ( python -m venv venv)
venv: create_venv
"./venv/Scripts/activate.bat" && pip install -r requirements.txt
run: venv
"./venv/Scripts/activate.bat" && python manage.py migrate && python manage.py runserver 0.0.0.0:8000
run_chrome: venv
start /B chrome http://127.0.0.1:8000/ && "./venv/Scripts/activate.bat" && python manage.py migrate && python manage.py runserver 0.0.0.0:8000
makemigrations: venv
"./venv/Scripts/activate.bat" && python manage.py makemigrations
migrate: venv
"./venv/Scripts/activate.bat" && python manage.py migrate
shell: venv
"./venv/Scripts/activate.bat" && python manage.py shell_plus
# quick (no checks on venv and migrations)
venv_quick: requirements.txt
"./venv/Scripts/activate.bat"
venv_quick_windows: requirements.txt
cmd \k "./venv/Scripts/activate.bat"
run_quick_chrome: venv_quick
start /B chrome http://127.0.0.1:8000/ && "./venv/Scripts/activate.bat" && python manage.py runserver 0.0.0.0:8000
run_quick: venv_quick
"./venv/Scripts/activate.bat" && python manage.py runserver 0.0.0.0:8000
shell_quick: venv_quick
"./venv/Scripts/activate.bat" && python manage.py shell_plus
# tests
test: venv
python manage.py test
test_keepdb: venv
python manage.py test --keepdb
# commands by setting esplicitly DB_TYPE
# run_postgres: venv
# "./venv/Scripts/activate.bat" && set DB_TYPE=postgres && python manage.py migrate && python manage.py runserver 0.0.0.0:8000
# shell_sqlite: venv
# "./venv/Scripts/activate.bat" && set DB_TYPE=sqlite && python manage.py shell_plus
# shell_postgres: venv
# "./venv/Scripts/activate.bat" && set DB_TYPE=postgres && python manage.py shell_plus
# run_postgres_quick: venv_quick
# "./venv/Scripts/activate.bat" && set DB_TYPE=postgres & python manage.py runserver 0.0.0.0:8000
# run_postgres_quick_chrome: venv_quick
# start /B chrome http://127.0.0.1:8000/ && "./venv/Scripts/activate.bat" && set DB_TYPE=postgres & python manage.py runserver 0.0.0.0:8000
# run_sqlite_quick: venv_quick
# "./venv/Scripts/activate.bat" && set DB_TYPE=sqlite && python manage.py runserver 0.0.0.0:8000
# shell_sqlite_quick: venv_quick
# "./venv/Scripts/activate.bat" && set DB_TYPE=sqlite && python manage.py shell_plus
# shell_postgres_quick: venv_quick
# "./venv/Scripts/activate.bat" && set DB_TYPE=postgres && python manage.py shell_plus
# test_sqlite: venv
# set DB_TYPE=sqlite && python manage.py test
# test_sqlite_keepdb: venv
# set DB_TYPE=sqlite && python manage.py test --keepdb
# test_postgres: venv
# set DB_TYPE=postgres && python manage.py test
# test_postgres_keepdb: venv
# set DB_TYPE=postgres && python manage.py test --keepdb