Skip to content

Commit

Permalink
feat(script): add django oscar
Browse files Browse the repository at this point in the history
add django oscar

Signed-off-by: Przemysław Pająk
  • Loading branch information
fearless-spider committed Jan 23, 2024
1 parent 29b060f commit ea64a95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A glamorous shell scripts with [gum](https://github.com/charmbracelet/gum) to cr
- User log in/out, sign up, password reset via django-registration
- Styling with Bootstrap v5
- Debugging with django-debug-toolbar
- e-commerce with [Django Oscar](https://github.com/django-oscar/django-oscar)

## 📖 Usage

Expand Down
12 changes: 11 additions & 1 deletion djcreator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gum style \
--align center --width 50 --margin "1 2" --padding "2 4" \
'Django Creator .::. PAJAK'

TYPE=$(gum choose "clean" "auth")
TYPE=$(gum choose "clean" "auth" "oscar")

if [ $TYPE = "clean" ]; then
gum confirm "It will create new python env with latest Django and it will create new project. Are you sure?"
Expand All @@ -27,6 +27,16 @@ elif [ $TYPE = "auth" ]; then
PROJECT_NAME=$(gum input --placeholder "Name of Django project")
./djvenv/bin/django-admin startproject "$PROJECT_NAME"
fi
elif [ $TYPE = "oscar" ]; then
gum confirm "It will create new python env with latest Django and it will create new project with Oscar framework. 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-oscar[sorl-thumbnail]
PROJECT_NAME=$(gum input --placeholder "Name of Django project")
./djvenv/bin/django-admin startproject "$PROJECT_NAME"
fi
fi

gum style \
Expand Down

0 comments on commit ea64a95

Please sign in to comment.