forked from DGNum/gestioCOF
Use last channels & co versions
- Use last official releases of channels, asgiref, daphne and asgi-redis packages. - Customization of JsonWebsocketConsumer is now in kfet app through a custom class (and so, doesn't require anymore a forked version of channels). - Clean kfet consumers code.
This commit is contained in:
parent
15861824b6
commit
1e18c4043e
2 changed files with 15 additions and 20 deletions
|
@ -1,26 +1,21 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (absolute_import, division,
|
from django.core.serializers.json import json, DjangoJSONEncoder
|
||||||
print_function, unicode_literals)
|
|
||||||
from builtins import *
|
|
||||||
|
|
||||||
from channels import Group
|
|
||||||
from channels.generic.websockets import JsonWebsocketConsumer
|
from channels.generic.websockets import JsonWebsocketConsumer
|
||||||
|
|
||||||
class KPsul(JsonWebsocketConsumer):
|
|
||||||
|
|
||||||
# Set to True if you want them, else leave out
|
class DjangoJsonWebsocketConsumer(JsonWebsocketConsumer):
|
||||||
strict_ordering = False
|
"""Custom Json Websocket Consumer.
|
||||||
slight_ordering = False
|
|
||||||
|
|
||||||
def connection_groups(self, **kwargs):
|
Encode to JSON with DjangoJSONEncoder.
|
||||||
return ['kfet.kpsul']
|
|
||||||
|
|
||||||
def connect(self, message, **kwargs):
|
"""
|
||||||
pass
|
|
||||||
|
|
||||||
def receive(self, content, **kwargs):
|
@classmethod
|
||||||
pass
|
def encode_json(cls, content):
|
||||||
|
return json.dumps(content, cls=DjangoJSONEncoder)
|
||||||
|
|
||||||
def disconnect(self, message, **kwargs):
|
|
||||||
pass
|
class KPsul(DjangoJsonWebsocketConsumer):
|
||||||
|
groups = ['kfet.kpsul']
|
||||||
|
|
|
@ -11,13 +11,13 @@ six==1.10.0
|
||||||
unicodecsv==0.14.1
|
unicodecsv==0.14.1
|
||||||
icalendar==3.10
|
icalendar==3.10
|
||||||
django-bootstrap-form==3.2.1
|
django-bootstrap-form==3.2.1
|
||||||
asgiref==0.14.0
|
asgiref==1.1.1
|
||||||
daphne==0.14.3
|
daphne==1.2.0
|
||||||
asgi-redis==0.14.0
|
asgi-redis==1.3.0
|
||||||
statistics==1.0.3.5
|
statistics==1.0.3.5
|
||||||
future==0.15.2
|
future==0.15.2
|
||||||
django-widget-tweaks==1.4.1
|
django-widget-tweaks==1.4.1
|
||||||
git+https://git.eleves.ens.fr/cof-geek/django_custommail.git#egg=django_custommail
|
git+https://git.eleves.ens.fr/cof-geek/django_custommail.git#egg=django_custommail
|
||||||
ldap3
|
ldap3
|
||||||
git+https://github.com/Aureplop/channels.git#egg=channels
|
channels==1.1.3
|
||||||
python-dateutil
|
python-dateutil
|
||||||
|
|
Loading…
Reference in a new issue