Little helpers for working with Slack bots 🤖 in Django.
Project description
django-slack-tools
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
[!WARNING] This project is still in early development and not recommended for production use.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_slack_tools-0.4.2.tar.gz.
File metadata
- Download URL: django_slack_tools-0.4.2.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
110377eb5f152cee5ae2ffc7a96f3fd2db1d5d3980f16b3dd4baf51c8ed9659f
|
|
| MD5 |
372c9af36353706b772492019c2e187a
|
|
| BLAKE2b-256 |
5a40af16deace345419e9a46dc155dbc71955815e8c55edfb6a68095b13d60fa
|
Provenance
The following attestation bundles were made for django_slack_tools-0.4.2.tar.gz:
Publisher:
release.yaml on lasuillard-s/django-slack-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_slack_tools-0.4.2.tar.gz -
Subject digest:
110377eb5f152cee5ae2ffc7a96f3fd2db1d5d3980f16b3dd4baf51c8ed9659f - Sigstore transparency entry: 1849330612
- Sigstore integration time:
-
Permalink:
lasuillard-s/django-slack-tools@89a3cb50f6770856d245512394847eaa474e2e29 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/lasuillard-s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@89a3cb50f6770856d245512394847eaa474e2e29 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_slack_tools-0.4.2-py3-none-any.whl.
File metadata
- Download URL: django_slack_tools-0.4.2-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e139523c89e3eaaf81a75c0fda980cf9f1abe982c284e41639c10c065024423
|
|
| MD5 |
f0147a70784666585863714bb3cace4a
|
|
| BLAKE2b-256 |
48f284570dc8006063c46fcec707b50b45be483931ba8ca4875584c3681caf3e
|
Provenance
The following attestation bundles were made for django_slack_tools-0.4.2-py3-none-any.whl:
Publisher:
release.yaml on lasuillard-s/django-slack-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_slack_tools-0.4.2-py3-none-any.whl -
Subject digest:
4e139523c89e3eaaf81a75c0fda980cf9f1abe982c284e41639c10c065024423 - Sigstore transparency entry: 1849330710
- Sigstore integration time:
-
Permalink:
lasuillard-s/django-slack-tools@89a3cb50f6770856d245512394847eaa474e2e29 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/lasuillard-s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@89a3cb50f6770856d245512394847eaa474e2e29 -
Trigger Event:
release
-
Statement type: