I recently started looking at django_eventstream to push data to a webpage instead of the client polling for updates.
I ran django_eventstream's time example, that was ok. I then configured my project to use events (asgi.py, routing.py, etc) and got one of my app's view.py to push an event to the web page. That worked, at least in testserver mode, so all seems configured ok.
Now what I'd like to do is run a script external to the Django project and send events from there, for example,
import os
import django
from django_eventstream import send_event
os.environ['DJANGO_SETTINGS_MODULE'] = 'my_project.settings
django.setup()
# ...some script logic
send_event('my_channel', 'message', 'my_message_content')
This results in the event being stored in the project's django_eventstream_event database table, but I never see it get pushed to the webpage. Wireshark shows the other web traffic but not the externally generated send_event messages.
My question is what is different about using send_event() within view.py versus in another script that may not be integral to the Django project? The external script does go through the django_setup() configuration process.
Using Python 3.7.3, Django 2.2.5, django_eventstream 2.6.0