Newer
Older
VIRTUAL_ENV ?= .venv
MANAGEPY = $(VIRTUAL_ENV)/bin/python manage.py
.PHONY: all
all: install run
.PHONY: run
run:
.PHONY: install
install:
if [ ! -d "$(VIRTUAL_ENV)" ]; then python3 -m venv "$(VIRTUAL_ENV)"; fi
$(MANAGEPY) migrate
$(MANAGEPY) shell -c "from django.contrib.auth.models import User; User.objects.filter(username='admin').exists() or User.objects.create_superuser('admin', 'admin@example.com', 'password')"
.PHONY: test
test:
$(VIRTUAL_ENV)/bin/flake8 scheduler
$(MANAGEPY) test