How to set global rounding for DecimalFields in Django project?
问题 I found similar question with answers, but "setting the option in the settings.py" and "setting getcontext() in apps.py" doesn't work. Standard decimal rounding is ROUND_HALF_EVEN, but I need to set ROUND_HALF_UP. And I repeat my question with a quote - "where in the Django application I have to set rounding option, so that it would work globally in the project?" 回答1: For django project can work setting decimal.DefaultContext (py3, py2). This context is most useful in multi-threaded