Hi,
-- I'm creating a prototype using Django Channels and I have a question that I haven't sorted out yet. First of all, big thanks to all django-channels developer, this is something I was missing for a long time.
So I have a connection that watches on a model and sends updates to a frontend. It looks something like this:
from channels import route_class
from channels.generic.websockets import WebsocketDemultiplexer
from dataSource.models import DataSourceBinding
class Demultiplexer(WebsocketDemultiplexer):
consumers = {
"datasource": DataSourceBinding.consumer,
}
def connection_groups(self):
return ["datasource-updates"]
channel_routing = [
route_class(Demultiplexer, path="^/datasource/")
]It works fine as far as some change is done, but I'd like to get initial data for an initial render, is there any good trick how to do this? I do I need to send a message and do it manually somehow?
Thank you.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2f177119-7043-4571-bb11-e9dacae19dad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment