Skip to content
Makefile 782 B
Newer Older
Bengfort's avatar
Bengfort committed
VIRTUAL_ENV ?= .venv
MANAGEPY = $(VIRTUAL_ENV)/bin/python manage.py

.PHONY: all
all: install run

.PHONY: run
run:
	$(MANAGEPY) runserver 8001
Bengfort's avatar
Bengfort committed

.PHONY: install
install:
	if [ ! -d "$(VIRTUAL_ENV)" ]; then python3 -m venv "$(VIRTUAL_ENV)"; fi
Hayat's avatar
Hayat committed
	$(VIRTUAL_ENV)/bin/pip install -U pip
Bengfort's avatar
Bengfort committed
	$(VIRTUAL_ENV)/bin/pip install -e .[test]
	npm install
Bengfort's avatar
Bengfort committed
	$(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')"
Bengfort's avatar
Bengfort committed
	$(MANAGEPY) compilemessages -l de
Bengfort's avatar
Bengfort committed

Bengfort's avatar
Bengfort committed
.PHONY: test
test:
	$(VIRTUAL_ENV)/bin/flake8 scheduler
	$(MANAGEPY) test

Bengfort's avatar
Bengfort committed
.PHONY: makemessages
makemessages:
	$(MANAGEPY) makemessages -l de -d django
	$(MANAGEPY) makemessages -l de -d djangojs