Open burakakca opened 2 months ago
@burakakca
If you want to use Hotwire Turbo Stream and Websocket to do real-time update.
Please check more details on this link https://django-turbo-helper.readthedocs.io/en/latest/real-time-updates.html
In your code, path("external",CustomActionCableConsumer.as_asgi())
seems not needed.
Thx.
In this doc, If i didn't miss something there two way one of them sse like below, other is actioncable right?
<turbo-stream-source src="http://127.0.0.1:3000/products/stream">
</turbo-stream-source>
But I'm trying to do this with actioncable.
Also I got another problem for {% load turbo_helper %}
jinja2 problem do you have idea to fix that?
@burakakca
The turbo_stream_from
from django-turbo-helper would help generate turbo-stream-source
element.
It has custom sign
value, so the server side should use from turbo_helper.channels.streams_channel import TurboStreamCableChannel
, or the Websocket request would not be processed. (This is for security reason)
As for jinja2
support, I might add the support in the future but now I have other things to do first.
If you do have this requirement, I suggest you to check how Wagtail do this with extension: https://docs.wagtail.org/en/stable/reference/jinja2.html
Thx.
Hi, I have Rails turbo streams and I want to subscribe from my django project. I Try to create a consumer for that but i didn't succeed. Is there a way to do that? Or I just need to use asyncio websocket client for that?
urlpatterns = [ path("cable", ActionCableConsumer.as_asgi()), path("external",CustomActionCableConsumer.as_asgi()) ]