Package: django-chatapp
Django Chat AppA flexible Chat Application for open source software society.Table of ContentsScreenshotsFeaturesPrerequisitesQuick StartCustomize SettingsContributingHistoryLicenseScreenshotsClient:Supporter panel:FeaturesSupporter panelPlay Tic-Toc-Toe game in client sideReport the clientWrite your ready messages and use them in Supporter panelEditable, Deletable messages and show or hide deleted message in supporter panel or client sideEmoji barReply messageRtl and Ltr templateShow client or supporter status (online | last seen recently)Double check for send and seen messageEasily customize settingsPrerequisitesYour project must use ASGI engine. You can use fromchannelsanddaphne.
for convert WSGI to ASGI, you can follow these commands.Install channels and daphne packages:pip install channels==4.0.0 daphne==4.0.0Then, In asgi.py file:importosfromdjango.core.asgiimportget_asgi_applicationfromchannels.routingimportProtocolTypeRouter,URLRouterfromchannels.authimportAuthMiddlewareStackfromchannels.sessionsimportSessionMiddlewareStackfromchatapp.routingimportws_urlpatternsos.environ.setdefault('DJANGO_SETTINGS_MODULE','App_Config.settings')application=ProtocolTypeRouter({'http':get_asgi_application(),'websocket':SessionMiddlewareStack(AuthMiddlewareStack(URLRouter(ws_urlpatterns)))})And in settings.py, adddaphneandchannelsto your INSTALLED_APPS.INSTALLED_APPS=[...'daphne','channels',]Then, You must edit this line:WSGI_APPLICATION='<your_app_name>.wsgi.application'to this line:ASGI_APPLICATION='<your_app_name>.asgi.application'And for last item, Add these codes for channel layer settings:CHANNEL_LAYERS={"default":{"BACKEND":"channels.layers.InMemoryChannelLayer"}}For run the server, just enough run this command:python3 manage.py runserverNow, You have a Async Project. ASGI applications support synchronous and asynchronous tasks.Quick startInstall django-chatapp in your project:pip install django-chatappAdd "chatapp" to your INSTALLED_APPS in settings.pyINSTALLED_APPS=[...'chatapp',]Include the chatapp URLconf in your project urls.py like this:fromchatapp.viewsimportsupporter_homepagepath('django-chatapp/chat/supporter/',supporter_homepage),path('',include('chatapp.urls',namespace='chatapp')),Runpython3 manage.py migrateto create the chatapp models.Now, You can include chatapp section to your main template:{% load chatapp %}

{% include_chatapp %}Customize SettingsSet direction of your template. Right to left, Left to right or Auto. If you setauto, you must have translation system in your project and your urls start with /en/ or /fa/ or /ar/ or /ru/.CHATAPP_DIR='ltr'# other value: rtl - ltr - autoSet chat application language. If you don't use translation system, you can set this value. If you setauto, you must have translation system in your project and your urls start with /en/ or /fa/ or /ar/ or /ru/.CHATAPP_LANGUAGE='en'# other value: auto - en - fa - ar - ruSet login url for supporter panel. If Supporter was not login, redirects to this url. as default, shows<h3>Login Required.</h3>to supporter.CHATAPP_SUPPORTER_LOGIN_URL='<your_url>'Editable message via Client:CHATAPP_EDIT_USER_MESSAGE=TrueDeleteable message via Client:CHATAPP_DELETE_USER_MESSAGE=TrueEditable message via Supporter:CHATAPP_EDIT_SUPPORTER_MESSAGE=TrueDeleteable message via Supporter:CHATAPP_DELETE_SUPPORTER_MESSAGE=TrueShow or Hide 'This message has been deleted.':CHATAPP_SHOW_DELETED_MESSAGE=TrueEnable game for Client:CHATAPP_GAME=TrueFields for client login is firstname, lastname and (phone? or email?)CHATAPP_AUTHFIELDS='email'# other value: phone OR emailTitle and SubTitle of chat box header:CHATAPP_TITLE='title'CHATAPP_SUBTITLE='please await.'Maximoum report for a Client:CHATAPP_MAX_REPORT_NUMBER=2The number of messages that are loaded at the first time:CHATAPP_MESSAGES_COUNT=30ContributingWe welcome contributions to our project! To contribute, please follow these steps:Fork this repository to your own accountClone your forked repository to your local machineCreate a new branch for your changesMake your changes and commit them with a descriptive commit messagePush your changes to your forked repositorySubmit a pull request :DPlease ensure that your code is well-tested and follows our code style guidelines. We also welcome bug reports, feature requests, and feedback on the project.
Thank you for contributing to our project!HistoryVersion 1.4 (2023-Mar-23) - First stable releaseLicenseMIT LicenseCopyright (c) 2023 django-chatappPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.