Skip to main content

Django one-to-one Websocket-based Asyncio-handled chat, developed by Bearle team

Project description

https://badge.fury.io/py/django-private-chat.svg https://travis-ci.org/Bearle/django-private-chat.svg?branch=master https://codecov.io/gh/Bearle/django-private-chat/branch/master/graph/badge.svg

Django one-to-one Websocket-based Asyncio-handled chat, developed by Bearle team

Documentation

The full documentation is at https://django-private-chat.readthedocs.io.

Quickstart

Install django-private-chat:

pip install django-private-chat

Migrate:

python manage.py migrate django-private-chat

Note: you can use this package with or without uvloop, just run either

python manage.py run_chat_server

or run

python manage.py run_chat_server_uvloop

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_private_chat.apps.DjangoPrivateChatConfig',
    ...
)

Add the server & port for your asyncio server to settings:

CHAT_WS_SERVER_HOST = 'localhost'
CHAT_WS_SERVER_PORT = 5002

It is possible to change messages datetime format using

DATETIME_FORMAT

Add django-private-chat’s URL patterns:

from django_private_chat import urls as django_private_chat_urls


urlpatterns = [
    ...
    url(r'^', include(django_private_chat_urls)),
    ...
]

Now you can start a dialog using

/dialogs/some_existing_username

Features

  • Uses current app model (get_user_model() and settings.AUTH_USER_MODEL)

  • Translatable (uses ugettext and {% trans %} )

  • One-to-one user chat

  • Works using WebSockets

  • Displays online/offline status

  • Display typing/not typing status

  • Soft deletable message model - be sure to keep messages to comply with message-keeping laws

  • TODO: add a dialog to the list when new one started

  • TODO: add user-not-found and other alerts

  • TODO: possible Redis backend intergration

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.1.1 (2017-02-10)

  • Added migrations.

0.1.0 (2017-02-10)

  • First release on PyPI.

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-private-chat-0.1.1.tar.gz (13.8 kB view hashes)

Uploaded Source

Built Distribution

django_private_chat-0.1.1-py2.py3-none-any.whl (18.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page