[Answer]-How to specify a global render() method of a python standard library object instances in django

1👍

Create your own datetime class and monkeypatch the datetime module early in the app setup.
(Maybe you need to monkeypatch all imported modules too, depends on how early you can do this

 import datetime

 class mydatetime(object):
     ...
     def render(self):
         ...

 datetime.datetime = mydatetime

It’s easier if you subclass the datetime object for sure, but you don’t have to.

👤Macke

Leave a comment