forked from retoor/snek
Add a new `/avatar/{uid}.svg` route served by `AvatarView` that generates deterministic SVG avatars using the `multiavatar` library keyed on user UID. Register the view in the application router and update `message.html` to replace the plain initial-letter avatar with an `<img>` tag pointing to the new endpoint. Also add `multiavatar` to project dependencies in `pyproject.toml`, introduce `python` and `run` convenience targets in the Makefile, and set aggressive `Cache-Control` headers on both the avatar and upload responses to reduce server load.
20 lines
345 B
Makefile
20 lines
345 B
Makefile
PYTHON=./.venv/bin/python
|
|
PIP=./.venv/bin/pip
|
|
APP=./.venv/bin/snek.serve
|
|
GUNICORN=./.venv/bin/gunicorn
|
|
GUNICORN_WORKERS = 1
|
|
PORT = 8081
|
|
|
|
python:
|
|
$(PYTHON)
|
|
|
|
run:
|
|
$(GUNICORN) -w $(GUNICORN_WORKERS) -k aiohttp.worker.GunicornWebWorker snek.gunicorn:app --bind 0.0.0.0:$(PORT) --reload
|
|
|
|
install:
|
|
python3 -m venv .venv
|
|
$(PIP) install -e .
|
|
|
|
|
|
|