Setup: multiple Django sites on the same set of servers served by the same Apache process group. Some sites - Eastern TK; some of them are central. A database is a PSQL running on a separate server.
When I started, I did not think about how different sites would handle time intervals; I think I saw the TIMEZONE setting in Django and just thought that she would "handle it." Now I see the cracks.
The first problem: the time zone seems to be flipping between East and Central. My understanding is that the search on this site is due to the fact that os environ var for TZ is installed in the Apache process, depending on which Django site processes the request, and if this process processes the request for the site on another TZ, the time the belt is wrong. I believe that the solution I found here was that sites of different time zones should have different groups of processes. Please correct if you are mistaken.
The second problem: locally on Linux I made a. / Manage.py server from one of my sites with central time (I am in the east). I created an asset whose publication date was correctly displayed one hour after the administrator. Looking at the actual PostgresSQL record, the date publishing timezone is still displayed as -04. Does Postgres use only the time zone of the server / computer itself and ignore any TZ settings in Django? So, all records stored on the Postgres server in Eastern time will be displayed as -04 or -05 depending on summer savings?
If someone else has done something similar, the tips will be appreciated. Even if I separated Apache processes for central sites so that their TZ settings did not overlap, I still have a Postgres problem. And then I am curious; if the PSQL timestamp is central and the TZ parameter is eastern, say, do the datetime data take into account the TZ fields? those. if you use datetime.datetime.now () when Django is set to EST and it returns 2:00 PM, then you have a content filter by publication date less than this result, will it only consider TZ search for content whose publication time is was 1:00 PM CST or earlier?
source share