django-eventstream icon indicating copy to clipboard operation
django-eventstream copied to clipboard

Can't connect to dynamic channels

Open owenljn opened this issue 2 years ago • 1 comments

Hi,

I tried to specify a list of dynamic channels using formatting based on view keywords, the configuration looks like below:

application = ProtocolTypeRouter({
    'http': URLRouter([
        path('events/<obj_id>', AuthMiddlewareStack(URLRouter(
            django_eventstream.routing.urlpatterns
        )), { 'format-channels': [object-{obj_id}] }),
        re_path(r'', get_asgi_application()),
    ]),
})

in my views.py, I have this:

def home(request):
    context = {}
    context['url'] = '/events/{obj_id}'
    context['last_id'] = get_current_event_id(['time', 'time2'])
    return render(request, 'timeapp/home.html', context)

However, it's not able to connect to any channel, can you help take a look see what was wrong with my configuration? Thanks.

Edit: If I want to specify a fixed list of channels, then I got this error: stream error: bad-request: Invalid request: Channel limit exceeded. it seems the maximum number of channels I can specify is 10, how do I specify more than 10 channels?

owenljn avatar Oct 25 '22 21:10 owenljn