Skip to main content

A Django app to help integrate Slack

Project description

Django Slack Integration

This application helps you to integrate your existing Django application with Slack.

It provides you with

  • Models - needed to keep information from Slack API
  • Decorators - help you to write implementation of your Slack endpoints
  • Authorisation backend - allows you to pair your existing user model with your Slack users
  • Views - OAuth callbacks for "Add To Slack" and "Login With Slack" actions


  1. Add 'slack_app' to your INSTALLED_APPS setting like this:

  2. Include the urls in your project like this:

    path('slack/', include('slack_app.urls')),
  3. Run python migrate to create the slack_app models.

  4. Add slack_app.auth_backends.SlackAuthenticationBackend to your AUTHENTICATION_BACKENDS

  5. Update your

  6. Add following URLs to your Slack app's Redirect URLs (OAuth & Permissions)

  7. (Optional) Put <your_host>/slack/interactivity/ as your Request URL in Interactive Components section

  8. (Optional) Configure your Slash commands's Request URL as <your_host>/slack/commands/<command_name>/


Slack commands

If you want to create a new Slack command with name /example, configure your Request URL as <your_host>/slack/commands/example/ and put the following code into inside your app's directory.

@slack_command('example', require_linked_account=True)
def scrumie_staging_command(request, slack_user_mapping, slack_workspace):
    print(slack_user_mapping, slack_workspace)
    return JsonResponse({
        "blocks": [
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "Hello _world_"
        "text": "Hello World"

Slack Interactivity

Put the following to your inside your app's directory.

def process_block_actions(payload):
    print('>>>>', payload)
    return HttpResponse()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-slack-app, version 1.0.40
Filename, size File type Python version Upload date Hashes
Filename, size django_slack_app-1.0.40-py3-none-any.whl (15.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-slack-app-1.0.40.tar.gz (11.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page