-
Notifications
You must be signed in to change notification settings - Fork 0
/
djcreator.sh
executable file
·55 lines (47 loc) · 2.16 KB
/
djcreator.sh
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
#!/bin/sh
gum style \
--foreground 201 --border-foreground 201 --border double \
--align center --width 50 --margin "1 2" --padding "2 4" \
'Django Creator .::. F3AR13SS'
TYPE=$(gum choose "clean" "auth" "shop" "blog")
if [ $TYPE = "clean" ]; then
gum confirm "It will create new python env with latest Django and it will create new project. Are you sure?"
if [ $? -eq 0 ]; then
python -m venv djvenv
./djvenv/bin/pip install --upgrade pip
./djvenv/bin/pip install django django-bootstrap-v5 django-debug-toolbar
PROJECT_NAME=$(gum input --placeholder "Name of Django project")
./djvenv/bin/django-admin startproject "$PROJECT_NAME"
fi
elif [ $TYPE = "auth" ]; then
gum confirm "It will create new python env with latest Django and it will create new project with login and register sections. Are you sure?"
if [ $? -eq 0 ]; then
python -m venv djvenv
./djvenv/bin/pip install --upgrade pip
./djvenv/bin/pip install django django-bootstrap-v5 django-debug-toolbar django-registration
PROJECT_NAME=$(gum input --placeholder "Name of Django project")
./djvenv/bin/django-admin startproject "$PROJECT_NAME"
fi
elif [ $TYPE = "shop" ]; then
gum confirm "It will create new python env with latest Django and it will create new project with Oscar Ecommerce + Stripe. Are you sure?"
if [ $? -eq 0 ]; then
python -m venv djvenv
./djvenv/bin/pip install --upgrade pip
./djvenv/bin/pip install django django-oscar[sorl-thumbnail] django-oscar-stripe-sca
PROJECT_NAME=$(gum input --placeholder "Name of Django project")
./djvenv/bin/django-admin startproject "$PROJECT_NAME"
fi
elif [ $TYPE = "blog" ]; then
gum confirm "It will create new python env with latest Django and it will create new project with Lotus blog application. Are you sure?"
if [ $? -eq 0 ]; then
python -m venv djvenv
./djvenv/bin/pip install --upgrade pip
./djvenv/bin/pip install django django-blog-lotus[api,breadcrumbs]
PROJECT_NAME=$(gum input --placeholder "Name of Django project")
./djvenv/bin/django-admin startproject "$PROJECT_NAME"
fi
fi
gum style \
--foreground 201 --border-foreground 201 --border double \
--align center --width 50 --margin "1 2" --padding "2 4" \
'Done!'