Answer the question
In order to leave comments, you need to log in
How to do a blocking operation in Python Django?
Implemented, for example, the user's balance, a function that writes off conditional money from this balance and does something (if there is enough money on the balance).
In this case, a field for fraud arises - for example, with a balance of 1000, you can simultaneously call the function to debit 1000 twice, they both check the balance, both are successful, and 1000 is debited twice.
Accordingly, the question is how blocking operations can be implemented in Django to avoid this ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question