QuickBlox JS-Django Sample Chat
- Install Python 3.8+ and Django 3.1.7 +
- Activate a virtual environment. You may need to install some additional packages if you are on Linux.
Run the command
python -m venv <my-env>and hit enter. You may need to usepython3on Unix. Please note that<my-env>can be a name of choice, but use something descriptive, likedjangovenv. Then after run the command<my-venv>\Scripts\activateon Windows orsource <my-env>/bin/activateon Unix. - Install the requirements by running
pip install -r requirements.txt - Run the server by running
python manage.py runserverin an active virtual environment. - Collect static files by running
python manage.py collectstatic - Open the browser and go to
http://localhost:8000/to see the app running. NOTE: You do not need to perform any database migrations as this app does not use the django ORM and Database. But this is a future enhancement.
This is a code sample for QuickBlox platform. It is a great way for developers using QuickBlox platform to learn how to integrate private and group chat, add text and image attachments sending into your application.
- Log in/log out
- Send and receive message/attachment
- Create and leave a 1-to-1 and group chat
- Create a public chat
- Display users who have received/read the message
- Mark messages as read/delivered
- Send typing indicators
- List and delete chats
- Display chat history
- Display a list with chat participants
- Optimised for Django [Still in Development]
QuickBlox application includes everything that brings messaging right into your application - chat, video calling, users, push notifications, etc. To create a QuickBlox application, follow the steps below:
- Register a new account following this link. Type in your email and password to sign in. You can also sign in with your Google or Github accounts.
- Create the app clicking New app button.
- Configure the app. Type in the information about your organization into corresponding fields and click Add button.
- Go to Dashboard => YOUR_APP => Overview section and copy your Application ID, Authorization Key, Authorization Secret, and Account Key.
To run a code sample, follow the steps below:
-
Download the code sample.
-
Get application credentials and get appId, authKey, authSecret, and accountKey.
-
Put these values in file QBconfig.js following samples => chat => js directory.
JavaScript
var QBconfig = { credentials: { appId: '', authKey: '', authSecret: '', accountKey: '' } } -
Run the code sample by opening index.html file.
The minimum requirements for QuickBlox JavaScript SDK are:
- JavaScript es5.
Sample documentation is available here.