Django — Apprise Notification Integration

How to send multi-channel notifications from Django using the Apprise library.

Why / When to Use

Use when you need to send alerts to multiple services (Slack, email, Discord, SMS, Teams, etc.) from Django without managing separate integrations for each.

Core Concept / Commands

Apprise supports 60+ notification services through a unified interface. Pure Python — no official Django app needed.

pip install apprise

Basic usage

import apprise
 
def send_notification(title, body):
    ap = apprise.Apprise()
    ap.add("slack://tokenA/tokenB/tokenC/#channel")
    ap.add("mailto://user:password@gmail.com")
    ap.add("discord://webhook_id/webhook_token")
    ap.notify(title=title, body=body)

Store URLs in settings.py

# settings.py
APPRISE_URLS = [
    "slack://tokenA/tokenB/tokenC/#alerts",
    "mailto://user:pass@gmail.com",
    "discord://webhook_id/webhook_token",
]
# Usage
from django.conf import settings
 
def send_notification(title, body):
    ap = apprise.Apprise()
    for url in settings.APPRISE_URLS:
        ap.add(url)
    ap.notify(title=title, body=body)

Django signal pattern

from django.db.models.signals import post_save
from django.dispatch import receiver
import apprise
 
@receiver(post_save, sender=Order)
def notify_on_order(sender, instance, created, **kwargs):
    if created:
        ap = apprise.Apprise()
        ap.add("slack://...")
        ap.notify(title="New Order", body=f"Order #{instance.id} received")

Celery async pattern

from celery import shared_task
import apprise
 
@shared_task
def send_async_notification(title, body, urls):
    ap = apprise.Apprise()
    for url in urls:
        ap.add(url)
    ap.notify(title=title, body=body)
 
# Call from view (non-blocking)
send_async_notification.delay("Alert", "Something happened", settings.APPRISE_URLS)

Key Options / Variants

TriggerUse Case
Django signalAuto-notify on model save/create/delete
Celery taskAsync notifications (don’t block requests)
Management commandBatch alerts on schedule
MiddlewareNotify on errors / specific request conditions

Gotchas

  • Apprise URL format varies per service — check Apprise wiki for exact syntax
  • Calling ap.notify() synchronously blocks the request — use Celery for production
  • No official Django package; handle configuration manually via settings.py

Source

Conversation: “Django integration with Apprise” — 2026-05-14

Updates — 2026-05-18

Verified: Apprise is a mature, battle-tested library — not new. Has been maintained since 2018/2019. Latest version is v1.9.7 with 100% test coverage. Used by Home Assistant, Uptime Kuma, and Fail2Ban as built-in integration. Good long-term choice for the Django project’s notification layer.

Updates — 2026-05-19

LINE Notification via Apprise

Prerequisites:

  1. Channel Access Token — Long Lived token from LINE Developers Console → Messaging API section (very long string ending with =)
  2. LINE User ID — starts with letter U; found in console under Basic Settings (NOT the @userid from the mobile app)

URL format:

line://<access_token>/<user_id>

Multiple recipients (separate with /):

line://<access_token>/<user_id1>/<user_id2>

Python example:

import apprise
 
ap = apprise.Apprise()
ap.add('line://YOUR_ACCESS_TOKEN/YOUR_USER_ID')
ap.notify(title='Alert', body='Hello from Apprise!')

CLI:

apprise -t "Alert" -b "Message" "line://YOUR_ACCESS_TOKEN/YOUR_USER_ID"

Config file (~/.apprise.yml):

urls:
  - line://YOUR_ACCESS_TOKEN/YOUR_USER_ID:
      tag: line