django-slack provides easy-to-use integration between Django projects and the Slack group chat and IM tool. It simplifies sending messages and notifications to Slack channels. Currently at version 5.19.0, it is actively maintained with regular updates, typically released multiple times a year to follow Django versions or introduce new features and fixes.
pip install django-slackVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to send a simple Slack message. It includes a minimal Django settings configuration to make the snippet runnable outside of a full Django project (e.g., as a standalone script). In a real Django project, ensure 'slack' is in `INSTALLED_APPS` and `SLACK_WEBHOOK_URL` (or `SLACK_TOKEN`) is defined in your `settings.py`.
Migrate to the new `slack.signals.message_sending` and `slack.signals.message_sent` signals, which provide similar functionality with a different signature. Review the official documentation for updated signal usage.
Update your `settings.py` to use `SLACK_WEBHOOK_URL`. The old setting might still work as a fallback but is considered deprecated.
Ensure all imports use `from slack import ...` (e.g., `from slack import slack_message`) instead of `from django_slack import ...`.
`SLACK_WEBHOOK_URL` is for incoming webhooks (simpler setup, limited features), while `SLACK_TOKEN` is for using the full Slack Web API (requires an app token, provides more control). Choose based on your integration needs and configure the respective setting in `settings.py`.