I have a Django application which sometimes needs to send some data through TCP and I want this connection to be persistant.
The way I wanted to do it was to create a simple Twisted TCP server (I'm the one who will be waiting for the initial connection) and somehow call it from a Django view whenever I would be needing it.
How should the communication look like beetwen Twisted and Django in this case?
Use the Twisted wsgi container to run Django. This container simply runs the WSGI application in multiple Twisted-threadpool threads, so you can simply call any Twisted API via blockingCallFromThread
. There's really not that much to it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With