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
Install
pip install django-slack-oauth
Set up
Add django_slack_oauth to your INSTALLED_APPS settings:
INSTALLED_APPS = (
...
'django_slack_oauth',
)
Run ./manage migrate; South or Django>=1.7 is required.
Include the application 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. You can set a custom local redirect using the SLACK_SUCCESS_REDIRECT attribute. Default is /
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
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 Distributions
Hashes for django-slack-oauth-0.4.macosx-10.10-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 695c1aa7507a5d2c61cd87fd6df6f16895c9361acfca00557d5fd5e8f11ff320 |
|
MD5 | c883520145fc94e96908dc040f5dfcaa |
|
BLAKE2b-256 | d6467f9394965c42149c1b80df43ffc7a1732a6ed7f19f6a9b0183c56e72b09f |