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-chat-app/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.2.tar.gz (293.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-chatapp-1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a33d6c00322c77a3b8fc851daf99d657c2562f0c4e64bf7407f6b997ef9004af
MD5 442fb8c2b5daa4d4f35c3231926c6409
BLAKE2b-256 425674923565ea301e37caa95dfe20885d214f2735437311a63c370543382c42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_chatapp-1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2a43b8084170a62f11de3eb8ef669a1d0f0031bdfb0935e063cc4a5d43137b8
MD5 dfece2de02d0189f7ff85f1fcc47e4fd
BLAKE2b-256 68bcd914c9b87b54f76cde023265d7be8c2f926b7daab34c8b14e9d46c25f160

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