Skip to main content

A complete chat application in your Django project.

Project description

PyPi Version GitHub stars Python Django Vue.js SASS

Django Chat App

a Free chat application in your website :) if you need a chat application in your django project, you can use from this package. client chat view and supporter panel view.

Some Properties

  1. supporter panel
  2. play game in client side
  3. report the user
  4. write ready messages in supporter panel
  5. customize chat setting like: edit & delete messages and show deleted message
  6. emoji bar
  7. reply message
  8. rtl and ltr template
  9. show status like online or offline
  10. double check for send and seen message

Prerequisites

your project must use ASGI engine. you can use from channels and daphne. for convert WSGI to ASGI, you can follow these commands.

  1. install channels and daphne packages:
pip install channels==4.0.0 daphne==4.0.0
  1. then, in asgi.py file:
import os
from django.core.asgi import get_asgi_application
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from channels.sessions import SessionMiddlewareStack
from chatapp.routing import ws_urlpatterns


os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'App_Config.settings')

application = ProtocolTypeRouter({
    'http': get_asgi_application(),
    'websocket': SessionMiddlewareStack(
        AuthMiddlewareStack(
            URLRouter(ws_urlpatterns)
        )
    )
})
  1. and in settings.py, add 'daphne', and 'channels', to your INSTALLED_APPS.
  2. then, you must edit this line:
WSGI_APPLICATION = '<your_app_name>.wsgi.application'

to this line:

ASGI_APPLICATION = '<your_app_name>.asgi.application'
  1. and for last item, add these codes:
CHANNEL_LAYERS = {
    "default": {
        "BACKEND": "channels.layers.InMemoryChannelLayer"
    }
}

now, you have a Async Project. ASGI applications support synchronous and asynchronous tasks.

Quick start

  1. Add "chatapp" to your INSTALLED_APPS in settings.py
  2. Include the chatapp URLconf in your project urls.py like this:
from chatapp.views import supporter_homepage

path('django-chatapp/chat/supporter/', supporter_homepage),
path('', include('chatapp.urls')),
  1. Run python manage.py migrate to create the chatapp models.
  2. at now, you can include chatapp section to your main template:
{% load chatapp %}
{% include_chatapp %}

Customize settings

set direction of template

CHATAPP_DIR = 'auto'    # other value: rtl - ltr - auto

editable message via client

CHATAPP_EDIT_USER_MESSAGE = True

deleteable message via client

CHATAPP_DELETE_USER_MESSAGE = True

editable message via supporter

CHATAPP_EDIT_SUPPORTER_MESSAGE = True

deleteable message via supporter

CHATAPP_DELETE_SUPPORTER_MESSAGE = True

show or not show 'this message is deleted'

CHATAPP_SHOW_DELETED_MESSAGE = True

enable game for client

CHATAPP_GAME = True

fields for login is firstname, lastname and (phone or email)

CHATAPP_AUTHFIELDS = 'email'     # phone - email

title and subtitle of chat box header

CHATAPP_TITLE = 'وبسایت تستی'
CHATAPP_SUBTITLE = 'لطفا کوشا باشید.'

maximoum report for users

CHATAPP_MAX_REPORT_NUMBER = 2

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-chatapp-1.3.tar.gz (293.8 kB view details)

Uploaded Source

Built Distribution

django_chatapp-1.3-py3-none-any.whl (301.9 kB view details)

Uploaded Python 3

File details

Details for the file django-chatapp-1.3.tar.gz.

File metadata

  • Download URL: django-chatapp-1.3.tar.gz
  • Upload date:
  • Size: 293.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for django-chatapp-1.3.tar.gz
Algorithm Hash digest
SHA256 991fa7339b96684190c7ce8c1c852d80c6dc0154e4eb5c3bd5e8e0a9958237ec
MD5 fec6030300e937dc99edf4c34e009a1c
BLAKE2b-256 4dd1fd127f393a751f19ec924dcdf6a2e312fc5a6e398d78563e38ba74cedb1c

See more details on using hashes here.

File details

Details for the file django_chatapp-1.3-py3-none-any.whl.

File metadata

  • Download URL: django_chatapp-1.3-py3-none-any.whl
  • Upload date:
  • Size: 301.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for django_chatapp-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8369f09666bd0310e6f2d752256b87d04f9019082e229a8b48d67eccb2689483
MD5 dc91ca5839d6e7c1edbb25d5748cd27c
BLAKE2b-256 1a58a10d8235f9cb00f91d246c131870ade6054e5bc16a54cfb2c20524cdb7ef

See more details on using hashes here.

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