2023-01-02 20:03:31 +01:00
|
|
|
all: css migrate
|
|
|
|
|
2023-01-05 21:10:17 +01:00
|
|
|
initialize: npm css migrate sethookdir loadplatforms
|
2023-01-02 20:03:31 +01:00
|
|
|
|
2023-01-20 13:37:46 +00:00
|
|
|
HTMLFILES := $(shell find games/templates -type f)
|
2024-06-26 17:14:36 +02:00
|
|
|
PYTHON_VERSION = 3.12
|
2023-01-03 00:13:26 +01:00
|
|
|
|
2023-01-03 12:34:50 +01:00
|
|
|
npm:
|
|
|
|
npm install
|
|
|
|
|
2023-02-18 20:35:59 +01:00
|
|
|
css: common/input.css
|
|
|
|
npx tailwindcss -i ./common/input.css -o ./games/static/base.css
|
2023-01-02 20:03:31 +01:00
|
|
|
|
|
|
|
makemigrations:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py makemigrations
|
2023-01-02 20:03:31 +01:00
|
|
|
|
|
|
|
migrate: makemigrations
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py migrate
|
2023-01-02 20:03:31 +01:00
|
|
|
|
2024-06-26 17:14:36 +02:00
|
|
|
init:
|
|
|
|
pyenv install -s $(PYTHON_VERSION)
|
|
|
|
pyenv local $(PYTHON_VERSION)
|
|
|
|
pip install poetry
|
|
|
|
poetry install
|
|
|
|
npm install
|
|
|
|
|
|
|
|
dev:
|
|
|
|
@npx concurrently \
|
|
|
|
--names "Django,Tailwind" \
|
|
|
|
--prefix-colors "blue,green" \
|
2024-06-26 18:35:05 +02:00
|
|
|
"poetry run python -Wa manage.py runserver" \
|
2024-06-26 17:14:36 +02:00
|
|
|
"npx tailwindcss -i ./common/input.css -o ./games/static/base.css --watch"
|
|
|
|
|
2023-01-02 20:03:31 +01:00
|
|
|
|
2023-01-07 21:59:34 +01:00
|
|
|
caddy:
|
|
|
|
caddy run --watch
|
|
|
|
|
2023-01-16 19:49:41 +01:00
|
|
|
dev-prod: migrate collectstatic
|
2023-01-20 13:37:46 +00:00
|
|
|
PROD=1 poetry run python -m gunicorn --bind 0.0.0.0:8001 timetracker.asgi:application -k uvicorn.workers.UvicornWorker
|
2023-01-07 21:09:47 +01:00
|
|
|
|
2023-01-19 19:35:25 +00:00
|
|
|
dumpgames:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py dumpdata --format yaml games --output tracker_fixture.yaml
|
2023-01-02 20:03:31 +01:00
|
|
|
|
|
|
|
loadplatforms:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py loaddata platforms.yaml
|
2023-01-02 20:03:31 +01:00
|
|
|
|
2023-01-20 19:58:31 +01:00
|
|
|
loadall:
|
|
|
|
poetry run python manage.py loaddata data.yaml
|
|
|
|
|
2023-01-02 20:03:31 +01:00
|
|
|
loadsample:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py loaddata sample.yaml
|
2023-01-03 00:13:26 +01:00
|
|
|
|
|
|
|
createsuperuser:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py createsuperuser
|
2023-01-03 22:04:22 +01:00
|
|
|
|
|
|
|
shell:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py shell
|
2023-01-05 12:19:56 +01:00
|
|
|
|
2023-01-07 21:09:47 +01:00
|
|
|
collectstatic:
|
2023-01-20 13:37:46 +00:00
|
|
|
poetry run python manage.py collectstatic --clear --no-input
|
2023-01-07 21:09:47 +01:00
|
|
|
|
2023-01-05 15:18:57 +01:00
|
|
|
poetry.lock: pyproject.toml
|
2023-01-05 12:19:56 +01:00
|
|
|
poetry install
|
|
|
|
|
|
|
|
test: poetry.lock
|
2023-01-05 21:10:17 +01:00
|
|
|
poetry run pytest
|
|
|
|
|
2023-01-07 21:09:47 +01:00
|
|
|
date:
|
2023-01-08 15:48:12 +01:00
|
|
|
poetry run python -c 'import datetime; from zoneinfo import ZoneInfo; print(datetime.datetime.isoformat(datetime.datetime.now(ZoneInfo("Europe/Prague")), timespec="minutes", sep=" "))'
|
2023-01-07 21:09:47 +01:00
|
|
|
|
|
|
|
cleanstatic:
|
2023-01-20 13:37:46 +00:00
|
|
|
rm -r static/*
|
2023-01-07 21:09:47 +01:00
|
|
|
|
2023-01-07 21:59:34 +01:00
|
|
|
clean: cleanstatic
|