Generates image to be rendered on a 32x16 RGB LED Grid
Ignore this file that is already committed git update-index --assume-unchanged static/weather.ppm
echo "DB_URL="sqlite:////app/database/db"" > .env
docker compose build
docker compose up# Auto format
docker exec -i app black .
# Run tests
docker exec -i app python -m pytest tests
# Update the banner display
docker exec -i app python update_display.py
# Run migrations
docker exec -it app alembic upgrade head
# Bash into container
docker exec -it app /bin/bash
# Examine db
sqlite3 db
# After editing and nginx file
sudo service nginx restartCheck the published version genreated during the docker build http://0.0.0.0:5002/persistent/version.txt
Container must have unless-stopped to survive reboots:
docker update --restart unless-stopped app*/5 * * * * docker exec -i app python update_display.py
0 4 * * * /sbin/reboot
If you don't have Pycharm Professional, one way to make unresolved references go away is
python3 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txtRead the nginx docs and be careful what you set as your root directory, so you don't unintentionally share private files.
If you see sqlite3.OperationalError: unable to open database file or related, make sure your
db file that contains the db agrees with the docker-compose.yaml volume
mount
Debugging w/ strace
# you can find the process running your code
ps -aux | grep python
strace -p 1778
# and step through that process
gdb -p 1778
ls /proc/1778
lsof -p 1772- upgrade python version
- start using
uvand pin package versions - move to a hosted db
- use AI to filter messages before posting