This article is about how to create a chat application or chat server using Django 2.0. This chat system depends Python 3 and Django restframework to create rest apis. Jquery ajax is using to call the api from the client side. I am using Ubuntu 16.04 to create this tutorial.
You can download the example source code from here:- https://dl.dropboxusercontent.com/s/obt4u4udlt30k8w/chatproj.zip
After download completed, extract the folder to somewhere on your computer, then open a terminal window inside the extracted project directory. Then run the following commands to create a virtual environment and activate.
For complete details about create a virtual environment read this article:- http://newprograminglogics.blogspot.com/2018/02/install-python-3-and-set-up-local.html
Then install Django by run this command
Then install Django rest framework
Then run these commands to create migrations
All configurations completed. Now start the server using this command
To check the functionality open http://127.0.0.1:8000/index in any browser
For reduce complexity I am not using a user login. You can simply login to chat by using your name or nickname without any log up process.
Enter your name like John , Peter in the From text box. Open the same url http://127.0.0.1:8000/index in another tab, type another name in it.
You can see the online users in the right column. Click one of the Names, you can see a chat box is opened. You can write messages in it and send to the selected user.
You can download the example source code from here:- https://dl.dropboxusercontent.com/s/obt4u4udlt30k8w/chatproj.zip
After download completed, extract the folder to somewhere on your computer, then open a terminal window inside the extracted project directory. Then run the following commands to create a virtual environment and activate.
virtualenv -p python3 env
source env/bin/activate
source env/bin/activate
For complete details about create a virtual environment read this article:- http://newprograminglogics.blogspot.com/2018/02/install-python-3-and-set-up-local.html
Then install Django by run this command
pip install django
Then install Django rest framework
pip install djangorestframework
Then run these commands to create migrations
python manage.py makemigrations chatapp
python manage.py migrate
python manage.py migrate
All configurations completed. Now start the server using this command
python manage.py runserver
To check the functionality open http://127.0.0.1:8000/index in any browser
For reduce complexity I am not using a user login. You can simply login to chat by using your name or nickname without any log up process.
Enter your name like John , Peter in the From text box. Open the same url http://127.0.0.1:8000/index in another tab, type another name in it.
You can see the online users in the right column. Click one of the Names, you can see a chat box is opened. You can write messages in it and send to the selected user.
Watch the video tutorial (Click the gear icon and select video quality to 1080p HD, then click the full screen button for good quality)
Go to this link to subscribe to my YouTube channel to stay updated:- https://www.youtube.com/channel/UCxTp2yDew9m48Ch_hArOoYw
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
DeleteThis comment has been removed by a blog administrator.
DeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThank you for sharing wonderful information with us to get some idea about that content.
ReplyDeleteDjango Online Courses
Django Training in Hyderabad
Python Django Online Training
Python Django Training in Hyderabad
Thank you for writing this informative post. Looking forward to read more.
ReplyDeleteWeb Design and Development Company In India
Why is there a trojan virus in the download link?
ReplyDeleteThis content is great good luckadvanced python
ReplyDeleteHi man, this really helped me.
ReplyDeleteThank you.
hi thanku somuch this infromation thanku so much
ReplyDeletecs executive
freecseetvideolectures/
We appreciate you writing the best post we've ever seen. Very straightforward and clear. Do this consistently. This is quite beneficial. Outstanding information was shared. We'll return to your website.
ReplyDeleteMobile App Development Company