Answer the question
In order to leave comments, you need to log in
How to make a thread safe tag?
I want to start with a simple increment in the template.
Wrote a tag, he added a unit to "himself", wrote the tag again, he added a unit to himself again.
BUT there is a doubt - a bunch of users went to the page and summed up ... :)
How to make it thread-safe?
PS (maybe I misunderstand something and my doubts are in vain - please clarify)
Answer the question
In order to leave comments, you need to log in
The template, and the tag is about the output of information. No need to make a tag that changes its state for some reason.
In yourself - where is it? Django is single threaded. But the WSGI server often runs it in multiple processes, so there shouldn't be any shared state anywhere other than the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question