https://github.com/null-none/drf-chat
Simple async and sync messaging app for Django Rest Framework
https://github.com/null-none/drf-chat
api chat drf python websocket
Last synced: 12 months ago
JSON representation
Simple async and sync messaging app for Django Rest Framework
- Host: GitHub
- URL: https://github.com/null-none/drf-chat
- Owner: null-none
- License: mit
- Created: 2021-11-05T11:42:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-10T10:29:55.000Z (over 4 years ago)
- Last Synced: 2025-02-26T19:40:41.286Z (about 1 year ago)
- Topics: api, chat, drf, python, websocket
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# drf-chat
Simple async and sync messaging app for Django Rest Framework
Features:
+ Facebook-style chat API
+ Websocket-based chat
+ Words blacklist
+ Files attachments
+ Firebase Messaging notifycations
### Installation
```
pip install drf-chat
```
```python
# REST
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
'EXCEPTION_HANDLER': 'drf_chat.exceptions.api_exception_handler',
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination'
}
```
* ASGI and Channels
```python
# Channels
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("localhost", 6379)],
},
},
}
ASGI_APPLICATION = "drf_chat.routing.application"
```
* Add drf_chat to your installed apps
```python
INSTALLED_APPS = [
...
'channels',
'rest_framework',
'rest_framework.authtoken',
...
'drf_chat'
]
```