fanout / django-eventstream

Server-Sent Events for Django
MIT License
664 stars 88 forks source link

send_event not sending an event in localhost #125

Open navitasconcepts opened 1 year ago

navitasconcepts commented 1 year ago

My versions are:

Django==3.2.14 django_eventstream==4.5.1 channels==3.0.5

I am running locally on a Mac with python manage.py runserver.

Following the README steps, The url path /events/ works correctly - however, send_events does not trigger an event. All i see are "keep-alive" events in the stream.

Any steps I am missing here?

Thanks.

jkarneges commented 1 year ago

Hi, are you running send_event from within that same runserver instance and not from a separate management command or anything?

Pawloski-engineer commented 1 year ago

I have a similar issue. I use celery to run a method that should invoke send_event. I receive empty responses when I connect to the eventsource on frontend.

Matteo961 commented 1 year ago

I am having the same here:

asgiref==3.7.2 channels==3.0.5 daphne==3.0.2 Deprecated==1.2.14 Django==4.2.3 django-cors-headers==4.2.0 django-eventstream==4.5.1 django-filter==23.2 django-grip==3.4.0 django-oauth-toolkit==2.3.0 djangorestframework==3.14.0 djangorestframework-simplejwt==5.2.2 gripcontrol==4.2.0

Matteo961 commented 1 year ago

Hi, are you running send_event from within that same runserver instance and not from a separate management command or anything?

This fixed my issue ! I was running the send_event from a manage.py shell. When running from the same instance it worked !