[Python] Django: global variables in multi-connections

Discussão em 'Python' iniciado por Stack, Agosto 8, 2025.

  1. Stack

    Stack Membro Participativo

    I developed a Django web-application and I tested it in local.. good news, it works!

    Know I am trying to move forward. I want to make it reachable via public Internet.. Bad news, it won't work!

    The client-side interact with server using Ajax and execute some Python script and get some result to display in the web page.

    The problem is that my application/server can't handle multiple connexions!

    I clarify:

    Mainly, the problem is that when more than one client are served (2 for example), each one will ask the server to run a Python script and, because there is a lot of global variables in the script, the two clients will modify them simultaneously and then bof!

    Can multi-threading be a solution? How?

    Continue reading...

Compartilhe esta Página