-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
111 lines (87 loc) · 2.12 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# constants
#
-include Makefile.def
.PHONY: static
TEST_APP=core
#
# end of constants
# targets
#
runserver:
@echo Starting $(PROJECT_NAME) ...
IS_DEV=1 $(MANAGE) runserver --noreload $(BIND_TO):$(RUNSERVER_PORT)
run: runserver compress
mailserver:
python -m smtpd -n -c DebuggingServer $(BIND_TO):$(MAILSERVER_PORT)
initproject:
$(MANAGE) syncdb --noinput
$(MANAGE) migrate
@echo loading initial data
$(MANAGE) loaddata $(PROJECT_NAME).json
$(MANAGE) create_data
@echo Done
syncdb:
@echo Syncing...
$(MANAGE) syncdb --noinput
$(MANAGE) migrate
shell:
@echo Starting shell...
$(MANAGE) shell
testcoverage:
mkdir -p tests/coverage/modules
TESTING=1 $(MANAGE) test_coverage $(TEST_OPTIONS) $(TEST_APP)
test:
TESTING=1 $(MANAGE) test $(TEST_OPTIONS) $(TEST_APP)
fast_test:
TESTING=1 FAST_TESTING=1 $(MANAGE) test $(TEST_OPTIONS) $(TEST_APP)
static:
@echo Collecting static
$(MANAGE) collectstatic --noinput
@echo Done
compress: static
@echo Compressing css and js
-rm -rf ./$(PROJECT_NAME)/static_media/static_root/CACHE/*
$(MANAGE) compress --force
@echo Done
clean:
@echo Cleaning up...
find ./$(PROJECT_NAME) | grep '\.pyc$$' | xargs -I {} rm {}
@echo Done
manage:
ifndef CMD
@echo Please, spceify -e CMD=command argument to execute
else
$(MANAGE) $(CMD)
endif
only_migrate:
ifndef APP_NAME
@echo Please, specify -e APP_NAME=appname argument
else
@echo Starting of migration of $(APP_NAME)
$(MANAGE) migrate $(APP_NAME)
@echo Done
endif
migrate:
ifndef APP_NAME
@echo "You can also specify -e APP_NAME='app' to check if new migrations needed for some app"
$(MANAGE) migrate
else
@echo Starting of migration of $(APP_NAME)
$(MANAGE) schemamigration $(APP_NAME) --auto
$(MANAGE) migrate $(APP_NAME)
@echo Done
endif
init_migrate:
ifndef APP_NAME
@echo Please, specify -e APP_NAME=appname argument
else
@echo Starting init migration of $(APP_NAME)
$(MANAGE) schemamigration $(APP_NAME) --initial
$(MANAGE) migrate $(APP_NAME)
@echo Done
endif
makemessages:
cd $(PROJECT_NAME); $(MANAGE_DOWN) makemessages -d djangojs -l ru
cd $(PROJECT_NAME); $(MANAGE_DOWN) makemessages -l ru -a
#
# end targets