There was a change in the docs between 4.2 and 5.0 that may explain your situation.
In 4.2, DATETIME_FORMAT:
Note that if
USE_L10Nis set toTrue, then the locale-dictated format has higher precedence and will be applied instead.
Since the USE_L10N setting was removed in 5.0, the docs now read:
Note that the locale-dictated format has higher precedence and will be applied instead.
(In other words, locale-defined formats always take precedence.)
This means that you either need to change the locale format, or specifically use this format in the template.