You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi,
I'm new to Django and would need some advice.
I've got a process launched with a command: python manage.py myprocess. I've got an infinite loop there where i use Group("mygroup").send({'text': state_text}). Everything is well displayed on my html page.
However i'd like to use buttons on my html page to stop this loop. Is there a way for my backgroundworker to get the value of which button was press on the html page?
Thank you
Shawn Milochik
unread,
Mar 6, 2017, 12:12:00 PM3/6/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
You'll have to send something from the browser (submit a form, AXAX, or websockets) to a Django view and update something somewhere -- in Redis or your database, probably. Then have your infinite loop check that location for an updated value. I recommend Redis for this purpose.
Melvyn Sopacua
unread,
Mar 6, 2017, 12:51:41 PM3/6/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
+1. In fact, I would not use Django to set the "stop looping" flag, since there is no advantage to that, unless the stops need to be tied to content in the database. But to just alter a value in redis, I'd use Nginx Redis2 module.