Python datetime.today() Showing different time in different python programms

Your offset of 5 and a half hours between the two results indicates you are probably located in India, and you found an issue with timezones. Try using datetime.utcnow() instead, and continue from there.

https://docs.python.org/3/library/datetime.html#datetime.datetime.utcnow


if you want, you can see this post about timezone on settings

https://quick-adviser.com/how-do-i-change-timezone-in-django-unchained/