Socket Connection between django servers
Question: I am newbie for django and python. The thing what I need is, connecting **more
than one django server with socket**. One of these servers (main server) will
get a request from mobile client with Django-REST API, and then, it should
transmit it to the other django servers related to an ID of the server. (e.g.
When main server gets data with an ID as 1, it should transmit the data to the
server#1, if it gets the data with ID 2, it should transmit the data to
server#2) I am looking forward your advices..

**p.s.** Http requests cannot be sent to the django servers except main one.
Each of them are intranet application and locations are different. The only
way to send data to these servers via http is, sending the request to main
server with the ID of the servers.


Answer: If you are not able to send an (internal) http request not even to localhost
you can try to speak to the WSGI API of the different django apps. The main
app might create a WSGI application object and fill it with pseudo request
data.

    
    
    # views.py of the main server
    
    def myview(self, request):
        # do some stuff
        if server_id = 1:
            from server_1_app.wsgi import application
            response = application(environ, pseudo_request)
        # ...
    

