No, you are mistaken for two reasons.
First, the use of "threads" is a bit vague here. Depending on how its server is configured, Django can be served either by threads, or by processes, or both (see the mod_wsgi documentation for a full discussion). If there is one thread for each process, you can guarantee that only one instance of the module will be available for each process. But it depends a lot on this configuration.
However, it is still not the case that during the request / response cycle there will be โexactly oneโ call to this function. This is due to the fact that the lifetime of the process is not completely associated with this cycle. The process will last for several requests, so the variable will be saved for all these requests.
source share