A simple, reusable Django app for handling and storing Slack events and slash commands.
Project description
# django-rest-slack
A simple, reusable Django app for handling and storing Slack events and slash commands.
## Requirements
- Python 3.6
- PostgreSQL
- Django 2.0+
- DRF
## Setup
- `pip install django django-rest-framework django-rest-slack`
- Include the following to your settings.py:
```
INSTALLED_APPS = [
'psycopg2-binary,
'rest_framework',
'rest_slack',
]
```
- Include the following to your urls.py:
```
from rest_slack.views import DRSEventView, DRSCommandView
api_patterns = ([
path('events/', DRSEventView.as_view()),
path('commands/', DRSCommandView.as_view()),
], 'api')
urlpatterns += [
path('api/v1/', include(api_patterns)),
]
```
- Add your environment variables:
```
export SLACK_CLIENT_ID='your-credential'
export SLACK_CLIENT_SECRET='your-credential'
export SLACK_VERIFICATION_TOKEN='your-credential'
export SLACK_BOT_USER_TOKEN='your-credential'
```
## Running with Zappa
- `pip install zappa`
- `zappa init`
- Create a Postgres DB in AWS RDS
- Update your zappa_settings.json with the `vpc_config` information:
```
"vpc_config" : {
"SubnetIds": [ "subnet-<id>","subnet-<id>" ],
"SecurityGroupIds": [ "sg-<id>" ]
}
```
- `zappa deploy <stage>`
- Update your settings.py with the hostname created in AWS
```
ALLOWED_HOSTS = ['host.name']
```
- `zappa update <stage>`
## Todo
- More detailed instructions / examples
A simple, reusable Django app for handling and storing Slack events and slash commands.
## Requirements
- Python 3.6
- PostgreSQL
- Django 2.0+
- DRF
## Setup
- `pip install django django-rest-framework django-rest-slack`
- Include the following to your settings.py:
```
INSTALLED_APPS = [
'psycopg2-binary,
'rest_framework',
'rest_slack',
]
```
- Include the following to your urls.py:
```
from rest_slack.views import DRSEventView, DRSCommandView
api_patterns = ([
path('events/', DRSEventView.as_view()),
path('commands/', DRSCommandView.as_view()),
], 'api')
urlpatterns += [
path('api/v1/', include(api_patterns)),
]
```
- Add your environment variables:
```
export SLACK_CLIENT_ID='your-credential'
export SLACK_CLIENT_SECRET='your-credential'
export SLACK_VERIFICATION_TOKEN='your-credential'
export SLACK_BOT_USER_TOKEN='your-credential'
```
## Running with Zappa
- `pip install zappa`
- `zappa init`
- Create a Postgres DB in AWS RDS
- Update your zappa_settings.json with the `vpc_config` information:
```
"vpc_config" : {
"SubnetIds": [ "subnet-<id>","subnet-<id>" ],
"SecurityGroupIds": [ "sg-<id>" ]
}
```
- `zappa deploy <stage>`
- Update your settings.py with the hostname created in AWS
```
ALLOWED_HOSTS = ['host.name']
```
- `zappa update <stage>`
## Todo
- More detailed instructions / examples
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-rest-slack-0.1.tar.gz
(2.5 kB
view details)
Built Distributions
File details
Details for the file django-rest-slack-0.1.tar.gz
.
File metadata
- Download URL: django-rest-slack-0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34f67887eec927b3137d3682ad3547eb892740ec0e1d14d1d587eaa0b6534a3a |
|
MD5 | a5e6a6dc140765b8ed15ce63441637fa |
|
BLAKE2b-256 | 6ef47d67e1911c16ab54e1198dc72025d9f17f0005d258efa63234aaaac814ca |
File details
Details for the file django_rest_slack-0.1-py3-none-any.whl
.
File metadata
- Download URL: django_rest_slack-0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45e8d732fdf345951613064120327d3c032957dbe2ec0e966534e698c20cbab4 |
|
MD5 | 1ac7a0e655cce7bc9446ad341eb201d0 |
|
BLAKE2b-256 | 4a96f6e5892040f0d84f23a15fb8f5286479527b4f24e461cd49a22d4d30c143 |
File details
Details for the file django_rest_slack-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: django_rest_slack-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c548f646d3938a6fd2d330ebd896260f6b8f10fc5b5d7c2a71194789c6a2690 |
|
MD5 | 66a92af8cfe4b67041ac8f5eae877f7b |
|
BLAKE2b-256 | dc8a77c856acb91d46e0a45fa3b4201aac7e42715fd1622e1f6abf2e775e02d4 |