Skip to main content

django-slack-tools

License: MIT codecov PyPI - Version

Little helpers for working with Slack bots 🤖 in Django.

This project aims to implement helpful features for Slack bots and to provide reusable Django apps with database integration.

✨ Features

  • Reusable Django app for Slack messaging with various messaging backends for different environments
  • Database-backed Slack messaging policies with simple dictionary-based templates
  • Message histories
  • Built-in admin for managing Slack workspace integrations
  • Celery support for messaging backends, management tasks, and shortcut workflows
  • Django template support

And more on the future roadmap...

  • New Django apps and helpers for Slack features such as modals, event subscriptions, etc.
  • Better templating experience
  • A more complete working example with richer documentation

Currently it is focused on messaging features. In the future, we hope to add more helpful Slack bot features across the ecosystem, such as event subscriptions, modals, and bot interactions.

🚀 Quick start

Install the package:

$ pip install django-slack-tools

Add the app to your Django settings:

INSTALLED_APPS = [
    ...
    "django.contrib.messages", # Used in admin
    "django_slack_tools.slack_messages",
    ...
]

Add configuration for the application (the Slack app should already be configured):

DJANGO_SLACK_TOOLS = {
    "slack_app": "<module.path.to.your-slack-app>",
    "messengers": {
        "default": {
            "class": "django_slack_tools.messenger.shortcuts.Messenger",
            "kwargs": {
                "template_loaders": [
                    "django_slack_tools.slack_messages.messenger.DjangoTemplateLoader",
                ],
                "middlewares": [],
                "messaging_backend": {
                    "class": "django_slack_tools.messenger.shortcuts.SlackBackend",
                    "kwargs": {
                        "slack_app": "<module.path.to.your-slack-app>",
                    },
                },
            },
        },
    },
}

Then run the database migration and create a greet.xml file in your templates/ directory:

<root>
    <block type="section">
        <text type="mrkdwn">
            {{ greet }}
        </text>
    </block>
</root>

Send a message:

from django_slack_tools.slack_messages.shortcuts import slack_message

message = slack_message(
    "<channel-id>",
    template="greet.xml",
    context={"greet": "Hello, World!"},
)

Please check the documentation for more examples and details.

💖 Contributing

All contributions and help are welcome. Please check the CONTRIBUTING.md file for contribution guides.

📜 License

This project is licensed under the terms of the MIT license.

Metadata

Release files for django-slack-tools 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-slack-tools 0.5.2
File Size Uploaded
django_slack_tools-0.5.2.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-slack-tools 0.5.2
File Interpreter ABI Platform
django_slack_tools-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / django_slack_tools-0.5.2.tar.gz

Download URL django_slack_tools-0.5.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1e920290c3b99b778aa0eb5e10c3aa957ebe1be779e2a2a580fb5e633e654a6f
BLAKE2b-256 checksum
How to use checksums
774a0957e1ae768401652d42d3842109881db0f0f29ab4da5dc4b4b1ce7b298e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / django_slack_tools-0.5.2-py3-none-any.whl

Download URL django_slack_tools-0.5.2-py3-none-any.whl
Size 50.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b521142286bfaa45371244340422c4357b24375f6693b40a2173fbee5710151
BLAKE2b-256 checksum
How to use checksums
bb33c855874d34d0fc500b8c9ef3c439159ed509cc90cff4a5df03cb2402488b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page