Skip to main content

Handles OAuth and stores slack token

Project description

Django module for handling Slack OAuth. In order to use Slack OAuth in your project you need to create application https://api.slack.com/applications

Installation

Add django_slack_oauth to your INSTALLED_APPS settings:

INSTALLED_APPS = (
    ...
    'django_slack_oauth',
)

Run ./manage syncdb to add table for storing token.

Include the djslack URLconf in your project urls.py:

url(r'^slack/', include('django_slack_oauth.urls')),

Set up in your settings, these are required:

SLACK_CLIENT_ID = os.environ.get('SLACK_CLIENT_ID')
SLACK_CLIENT_SECRET = os.environ.get('SLACK_CLIENT_SECRET')
SLACK_AUTHORIZATION_URL = 'https://slack.com/oauth/authorize'
SLACK_OAUTH_ACCESS = 'https://slack.com/api/oauth.access'

Also you can provide in your settings custom scope with SLACK_SCOPE attribute. Default scope is identify,read,post

Use the url to authenticate your users in your templates

<a href='{% url 'slack_auth' %}'>Get slacked</a>

Find your token in slack_user table

Project details


Download files

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

Source Distribution

django-slack-oauth-0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page