-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboom
executable file
·44 lines (30 loc) · 1.27 KB
/
boom
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
#!/bin/sh
PROJECT=$1
APP=$2
# for postgres on OSX installed via brew, the root user is your main user
DEFAULT_DB_USER=`eval whoami`
cd $3
# Create Templates
django-admin.py startproject --template=https://github.com/loogica/loogica_project_template/archive/master.zip $PROJECT
cd $PROJECT/$PROJECT
django-admin.py startapp --template=https://github.com/loogica/loogica_app_template/archive/master.zip $APP
# config: settings/base.py settings/local.py urlspy Makefile
sed "s/\$APP/$APP/g" $PROJECT/settings/base.py > $PROJECT/settings/_base.py
mv $PROJECT/settings/_base.py $PROJECT/settings/base.py
sed "s/\$APP/$APP/g" $PROJECT/urls.py > $PROJECT/_urls.py
mv $PROJECT/_urls.py $PROJECT/urls.py
sed "s/\$APP/$APP/g;s/\$PROJECT/$PROJECT/g" Makefile > _Makefile
mv _Makefile Makefile
sed "s/\$PROJECT/$PROJECT/g;s/\$DEFAULT_DB_USER/$DEFAULT_DB_USER/g" $PROJECT/settings/local.py > $PROJECT/settings/_local.py
mv $PROJECT/settings/_local.py $PROJECT/settings/local.py
sed "s/\$PROJECT/$PROJECT/g" $PROJECT/settings/production.py > $PROJECT/settings/_production.py
mv $PROJECT/settings/_production.py $PROJECT/settings/production.py
# Posgtres createdb
createdb $PROJECT
# Django venv and migration bootstraping
make venv_boot
make dbreset
make dbinitial
make migrate
# Run!!
make runserver