Async Chatter App Based on Webscokets
The full documentation is at https://django-chats.readthedocs.io.
Install chatter:
pip install django-chats
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'chatter.apps.chatter',
...
)
Add chatter's URL patterns:
from django.urls import re_path, include
from chatter import urls as chatter_urls
from chatter.api import urls as chatter_api_urls
urlpatterns = [
...
re_path(r'^', include(chatter_urls)),
re_path(r'^', include(chatter_api_urls)),
...
]
Redis need to be configured for group chatting:
import platform
# Configure the redis server
CHANNEL_LAYERS = {
'default': {
'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {
# "hosts": [('192.168.99.100', 6379) if platform.system()=='Windows' else ('127.0.0.1', 6379)],
# for docker
"hosts": [('redis', 6379)]
},
},
}
Official acount username could be specified or by default: "official_user"
- Support Realtime communication through ASGI compatible Server
- Automatically generated official account if not specified
- Message implemented using django-restframework
- EmojiPicker Intergration(credit:OneSignal)
docker-compose build
docker-compose up
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
pip install -r requirements_dev.txt invoke -l