My Django project correctly has timezones enabled and it always stores times with timezone in the Postgres database.
There is just one table my project needs to access that is managed by another application. To access this other table I have configured a second database, a database router, and an unmanaged model. It all works perfectly.
However, this external table has some DateTimeFields that are without timezone. This is not my choice, but I have no control over it. The result is that when working with this model, Django will spit out many of the “received a naive datetime” warnings. Is there any way to tell Django that I know those specific DateTimeFields are not timezone aware, and that it should not warn me when they receive naive datetimes?
Actual Result: There is a RuntimeWarning about receiving a naive datetime while time zone support is active.
Desired Result: No warning because this is a special case where we know the time is naive. There should be some way to indicate to the Django model that this specific DateTimeField is an exception, and it’s OK if it is a naive time with no timezone
Oh, thanks. I suppose that works to avoid the error. It just seems a bit silly to go through the trouble of adding the time zone when it’s just going to be thrown out as the database column can’t accommodate it.