Configuration options

Required config

SLACKCHAT_SLACK_VERIFICATION_TOKEN

Slack app verification token.

SLACKCHAT_SLACK_API_TOKEN

Slack app OAuth access token.

SLACKCHAT_PUBLISH_ROOT

The URL root of your front end. It will be combined with the publish_path of both the ChatType and Channel to create preview links in the CMS.

For example, if you have a ChatType with the publish_path of /my-custom-type/ and your channel’s publish_path is my-chat you might expect that this chat will be published at https://my-site.com/slack-chats/my-custom-type/my-chat/. In this case your SLACKCHAT_PUBLISH_ROOT would be https://my-site.com/slack-chats/.

SLACKCHAT_TEAM_ROOT

The URL for your Slack team. It should take the form of https://your-team.slack.com. This is also used to create links in your CMS.

SLACKCHAT_DEFAULT_OWNER

The Slack user ID for the default owner of new Slack Chats. While the CMS requires that user’s be logged in, if the logged-in Django user does not have a matching Slackchat user, this default owner will be set as the owner and invited to any new chats.

Additional config

SLACK_WEBHOOK_VERIFICATION_TOKEN

A custom token that will be sent in webhook notification post data as token. This can be used to verify requests to your renderer’s endpoint come from slackchat.

# default
SLACK_WEBHOOK_VERIFICATION_TOKEN = 'slackchat'

SLACKCHAT_PUBLISH_ROOT

Configuring this to the URL root where your slackchats are published by a renderer will add a direct link to each chat in the Channel Django admin.

# e.g.
SLACKCHAT_PUBLISH_ROOT = 'https://mysite.com/slackchats/'

SLACK_MARKSLACK_USER_TEMPLATE

A function used to create a user_templates object in markslack. The function should take a User instance argument and return a formatted string.

# default
SLACK_MARKSLACK_USER_TEMPLATE = lambda user: '<span class="mention">{} {}</span>'.format(
    user.first_name,
    user.last_name
)

SLACK_MARKSLACK_IMAGE_TEMPLATE

A markslack image_template object.

# default
SLACK_MARKSLACK_IMAGE_TEMPLATE = '<figure><img href="{}" /></figure>'

SLACKCHAT_USER_IMAGE_UPLOAD_TO

A function used to set the upload path used when copying Slack user profile images to your own server.

# default
def default_user_image_upload_to(instance, filename):
    return 'slackchat/users/{0}{1}/{2}'.format(
        instance.first_name,
        instance.last_name,
        filename,
    )

SLACKCHAT_USER_IMAGE_UPLOAD_TO = default_user_image_upload_to

SLACKCHAT_MANAGERS

An array of Slack User IDs. These users will be automatically invited to any new channels made by this app.

# default
SLACKCHAT_MANAGERS = []

SLACKCHAT_CMS_TOKEN

A token used to authenticate API requests made by the CMS. Defaults to a random hash created on server startup, but you can use this setting to set it explicitly if you want to use the API endpoint to create/update Channel models.

# default
SLACKCHAT_CMS_TOKEN = "%032x" % random.getrandbits(128)