Skip to content

borvelt/realtime-django-channels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-time app with django-channels

djago channels help you to have socket programming experince with django routers, it's incredible, isn't it?

First of all you should know that this project is a light sample chat application, but it not mean that codes are ugly or experimental.

Installation

Make sure your python version is 3 or later. Clone or download repository and then:

# bash
virtualenv .env
source .env/bin/activate

Now install packages.

# bash
$ pip install -r requirements.txt

Install redis server or some thing like redis(if your not using redis or use on different port see CHANNEL_LAYERS in chatApp/settings.py )

Database Migration:

$ python manage.py migrate

You should serve websocket part of your project with daphne, just like this:

$ daphne chatApp.asgi:channel_layer -p 8000 -b localhost -v2

This command will run websocket interface of your project with daphne. You should handle HTTP requests, so simply run this command:

$ python manage.py runworker -v2

Usage

Application just work in /chat url that this url need authentication, create superuser with manage.py interface.

Test

This project doesn't have any unit tests, Please help me.

License

MIT