[Django]-Django python – are class attributes values shared between requests?

5👍

It depends.

Any requests that are served by the same process will use the same class, so will see the added data. Requests that are served by a different process will see any data added by previous requests on that process.

So, since you can’t predict what process will serve any particular request, you can’t count on this either happening or not happening. In other words, don’t do this at all.

Leave a comment