This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
# django-websocket-channel
Websocket support for Django using Redis


#Installation

<pre>
sudo service redis-server start
</pre>


<pre>
pip install django-websocket-channel
</pre>


#Configuration

<pre>
INSTALLED_APPS = (
...
'websocket_channel',
...
)
</pre>


<pre>
WS_REDIS = {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None,
}
</pre>

<pre>
TEMPLATE_CONTEXT_PROCESSORS = (
...
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.static',
'websocket_channel.context_processors.default',
...
)


</pre>

django 1.8


<pre>
TEMPLATES = [
{
'''
'OPTIONS': {
'context_processors': [
'''
'django.template.context_processors.static',
'django.contrib.messages.context_processors.messages',
'websocket_channel.context_processors.default',
'''
],
},
},
]


</pre>


#NGiNX
<pre>
server {
'''
location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://unix:/tmp/websocket_channel_websocket.socket;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/websocket_channel.socket;

}

'''

}
</pre>

#uWSGI:

<pre>
[default]
gid = www-data
uid = www-data
umask = 002
;virtualenv = virtualenv/path
master = true
env=DJANGO_SETTINGS_MODULE=settings


env=PYTHON_EGG_CACHE=/tmp/websocket_channel
env=LANG=zh_CN.UTF-8
env=LC_ALL=zh_CN.UTF-8
ignore-sigpipe = true
enable-threads = true
chmod-socket = 666
chdir = project/path/to
pythonpath = project/path/to
max-requests = 500000



[runserver]
ini = :default
socket = /tmp/websocket_channel.socket
pidfile = /tmp/websocket_channel.pid
module = wsgi
buffer-size = 32768
processes = 4
daemonize = project/path/to/web.log

[wsserver]
ini = :default
http-socket = /tmp/websocket_channel_websocket.socket
pidfile = /tmp/websocket_channel_websocket.pid
daemonize = project/path/to/websocket_web.log
module = wsgi_websocket
processes = 1
http-websockets = true
gevent=1000


</pre>

#Then start uWSGI:
<pre>
uwsgi --ini uwsgi.ini:runserver
uwsgi --ini uwsgi.ini:wsserver
</pre>


#Client JavaScript
<pre>
<script type="text/javascript" src="{{ STATIC_URL }}js/dj_websocket.js"></script>
<script type="text/javascript">
var ws = new DjWebSocket({uri: '{{ WEBSOCKET_URL }}'});
ws.onopen = function(){
ws.subscribe("channel", function(data){
//channel msg
});

}
</script>

</pre>


#Subscribe to Broadcast Notifications
<pre>
RedisPublisher("channel").publishgit _message("1111111111")
</pre>
Release History

Release History

0.0.5

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-websocket-channel-0.0.5.tar.gz (15.0 kB) Copy SHA256 Checksum SHA256 Source May 31, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting