django-test/commands.sh

18 lines
696 B
Bash

# init db with flush
docker-compose exec web python manage.py flush --no-input && \
docker-compose exec web python manage.py migrate && \
docker-compose exec web python manage.py createsuperuser
# make migrations for app
# python manage.py makemigrations polls
#init in production
docker-compose -f ./docker-compose.prod.yaml exec web python manage.py flush --no-input && \
docker-compose -f ./docker-compose.prod.yaml exec web python manage.py migrate && \
docker-compose -f ./docker-compose.prod.yaml exec web python manage.py createsuperuser
# collect static files
python manage.py collectstatic --no-input --clear
# start production
docker-compose -f ./docker-compose.prod.yaml up --build