1👍
Is there a way to do this with my current setup?
Yes! Using multiprocessing
. See answer of this question – Accessing python class variable defined inside the main module of a script
1👍
I think your idea here is valid. That you want clear separation between processing code and communication code. There are many ways to solve this problem, one simple way I can think of is to have a Queue object in your GCMApp Server and make a thread block on the Queue.get() method. Have the same Queue object shared with the processing django app, and whenever processed data is available push it in the Queue. The blocked thread would wake up and send it to the devices. Other way are instead of using the Queue you can use socket. Another way is having a eventloop, https://docs.python.org/3/library/asyncio-eventloop.html , this is available in python 3.0 but you can look at eventloops in general. I would suggest you to start from something simple and get it working and then start making it beautiful.
Let me know if it makes sense.