Skip to content

Simple async and sync messaging app for Django Rest Framework

License

Notifications You must be signed in to change notification settings

null-none/drf-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
# 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
# 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
INSTALLED_APPS = [
   ...
   'channels',
   'rest_framework',
   'rest_framework.authtoken',

   ...
   
   'drf_chat'
]

About

Simple async and sync messaging app for Django Rest Framework

Topics

Resources

License

Stars

Watchers

Forks

Languages