Django Channels (notification library)

raw JSON →
0.7.0 verified Mon Apr 27 auth: no python deprecated

A Django library for sending notifications through various channels (e.g., HipChat, Slack, Yo). Latest version is 0.7.0, but the project was renamed to kawasemi as of v0.8.0. The rename introduced breaking import changes. PyPI slug is django-channels but the active development continues under the new name. Release cadence is irregular.

pip install django-channels==0.7.0
error ModuleNotFoundError: No module named 'django_channels'
cause django-channels v0.7.0 installed but import uses wrong name.
fix
Use 'import django_channels' (with dash not underscore) or better, install kawasemi and use 'from kawasemi.django import send'.
error ImportError: cannot import name 'send' from 'django_channels'
cause The send function is not available in the old v0.7.0 django-channels package's __init__.py. It lives in a submodule.
fix
Use 'from django_channels import send' only if you have the correct version. Actually in v0.7.0, the correct import is 'from django_channels import send' but the package is outdated; upgrade to kawasemi.
breaking Package renamed from django-channels to kawasemi as of v0.8.0. All imports and code must be updated.
fix pip install kawasemi and change imports to kawasemi.
breaking In v1.0.0, the Django API changed from direct module-level send() to kawasemi.django.send().
fix Use 'from kawasemi.django import send' instead of 'import kawasemi; kawasemi.send()'.
deprecated Python 3.3 support dropped in v2.0.0, Python 3.4 support dropped in v3.0.0.
fix Upgrade Python to 3.5+ for v2.x, 3.5+ for v3.x.

Minimal example using the old django-channels package (v0.7.0). For the latest, use kawasemi.

# Django integration for django-channels v0.7.0 (old naming)
# Note: This is the deprecated version; use kawasemi for current code.

# settings.py
CHANNELS = {
    'hipchat': {
        'api_id': os.environ.get('HIPCHAT_API_ID', ''),
        'api_token': os.environ.get('HIPCHAT_API_TOKEN', ''),
        'room_id': '12345',
    }
}

# In your code
import django_channels
from django_channels import send
send('Hello from v0.7.0!')