Skip to content

Latest commit

 

History

History
77 lines (68 loc) · 1.79 KB

File metadata and controls

77 lines (68 loc) · 1.79 KB

[x] accounts.User ↓ [x] monitoring.MonitoringProfile ↓ [x] integrations.ConnectedSource ↓ [x] monitoring.IncomingMessage ↓ [x] monitoring.Event ↓ [x] ai.AIAnalysisResult ↓ [x] alerts.AlertDelivery

shell

docker compose exec web python manage.py shell

make migrations in docker env

docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py check
docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py makemigrations accounts monitoring integrations ai alerts
docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py migrate

check migrations

docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py check
docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py showmigrations

shell

docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py shell

celery logs

docker compose logs -f celery_worker

pytest

all tests

docker compose run --rm -e RUN_MIGRATIONS=0 web pytest
docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py telegram_webhook set \
  --source-id 1 \
  --base-url https://identify-symbols-often-suggested.trycloudflare.com     \
  --drop-pending-updates

Telegram polling for local development

Webhook requires public HTTPS URL. For local development use polling.

Disable webhook before polling

docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py telegram_webhook delete \
  --source-id 2 \
  --drop-pending-updates

Start polling

docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py telegram_poll \
  --source-id 2

One-time polling check

docker compose run --rm -e RUN_MIGRATIONS=0 web python manage.py telegram_poll \
  --source-id 2 \
  --once