Last active
May 14, 2025 04:23
-
-
Save rg3915/7842b05ff93d9fd87f977d3c0b9300d3 to your computer and use it in GitHub Desktop.
Django Boilerplate with Copier (Django Ninja) 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script rápido para Linux. No Windows siga o passo a passo do README. | |
# Repo completo no Github: https://github.com/rg3915/copier-django-template | |
# Salva o diretório atual em uma variável | |
CURRENT_FOLDER=$(pwd) | |
# echo "Diretório inicial: $CURRENT_FOLDER" | |
# Cria a pasta /tmp/boilerplate se não existir | |
if [ ! -d "/tmp/boilerplate" ]; then | |
# echo "Criando diretório: /tmp/boilerplate" | |
mkdir -p /tmp/boilerplate | |
else | |
echo "Diretório já existe: /tmp/boilerplate" | |
fi | |
# Entra na pasta /tmp/boilerplate | |
cd /tmp/boilerplate | |
echo "Você está agora em: $(pwd)" | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install copier | |
copier copy https://github.com/rg3915/copier-django-template.git $CURRENT_FOLDER | |
deactivate | |
# Volta para o diretório inicial | |
cd "$CURRENT_FOLDER" | |
echo "Voltou para: $(pwd)" | |
rm -f script.sh | |
rm -rf img | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install -r requirements.txt | |
cp env.sample .env | |
python manage.py migrate | |
python manage.py createsuperuser --username="admin" --email="[email protected]" | |
tree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment