Standalone admin panel with all data stored in SQLite database
| Tasks Page | Task Details Page |
|---|---|
![]() |
![]() |
- Import and connect the middleware to the broker:
...
from taskiq.middlewares.taskiq_admin_middleware import TaskiqAdminMiddleware
broker = (
RedisStreamBroker(
url=redis_url,
queue_name="my_lovely_queue",
)
.with_result_backend(result_backend)
.with_middlewares(
TaskiqAdminMiddleware(
url="http://localhost:3000", # the url to your taskiq-admin instance
api_token="supersecret", # any secret enough string
taskiq_broker_name="mybroker",
)
)
)
...-
Pull the image from GitHub Container Registry:
docker pull ghcr.io/taskiq-python/taskiq-admin:latest -
Replace
TASKIQ_ADMIN_API_TOKENwith any secret enough string and run:
docker run -d --rm \
-p "3000:3000" \
-v "./taskiq-admin-data/:/usr/database/" \
-e "TASKIQ_ADMIN_API_TOKEN=supersecret" \
--name "taskiq-admin" \
"ghcr.io/taskiq-python/taskiq-admin:latest"- Go to
http://localhost:3000/tasks
services:
queue:
build:
context: .
dockerfile: ./Dockerfile
container_name: my_queue
command: taskiq worker app.tasks.queue:broker --workers 1 --max-async-tasks 20
environment:
- TASKIQ_ADMIN_URL=http://taskiq_admin:3000
- TASKIQ_ADMIN_API_TOKEN=supersecret
depends_on:
- redis
- taskiq_admin
taskiq_admin:
image: ghcr.io/taskiq-python/taskiq-admin:latest
container_name: taskiq_admin
ports:
- 3000:3000
environment:
- TASKIQ_ADMIN_API_TOKEN=supersecret
volumes:
- admin_data:/usr/database/
volumes:
admin_data:cp env-example .env, enter.envfile and fill in all needed variables- run
make devto run it locally in dev mode - run
make prodto run it locally in prod mode
Let's assume we have a task 'do_smth', there are all states it can embrace:
queued- the task has been sent to the queue without an errorrunning- the task is grabbed by a worker and is being processedsuccess- the task is fully processed without any errorsfailure- an error occured during the task processingabandoned- taskiq-admin sets all 'running' tasks as 'abandoned' if there was a downtime between the time these tasks were in 'running' state and the time of next startup of taskiq-admin
- Run
pnpm installto install all dependencies - Run
pnpm db:pushto create the sqlite database if needed - Run
pnpm devto run the project

