在 KiwiTCMS 中设置时区
Setting Timezone in KiwiTCMS
我们目前正在尝试使用 docker 将 KiwiTCMS 实施到我们的工作流程中。我们已经看到,应该可以通过更改设置中的环境变量 KIWI_TIME_ZONE
或 TIME_ZONE
来更改 KiwiTCMS 中的时区。
因此,我们尝试将 docker-compose.yml
内的环境变量设置为 KIWI_TIME_ZONE: Europe/Berlin
或将设置文件添加为卷 TIME_ZONE = 'Europe/Berlin'
.
我们已将名为 default_config.py
的设置文件添加到 docker-compose.yml
中,如下所示:
volumes:
- ./my_settings_dir/default_config.py:/venv/lib64/python3.8/site-packages/tcms_settings_dir/default_config.py
该卷看起来已正确实施,因为我们在同一文件中更改的其他设置有效。但是在这些文件中的任何一个中设置时区变量只会将时钟旁边的时区名称更改为 Europe/Berlin
但时钟时间和上次用户登录时间都不会更改,它们仍然显示 UTC 时间。
作为 运行 docker 容器的服务器时间和两个 docker 容器(DB 和 Kiwi)的时间设置为 Europe/Berlin
以便应该不是问题。
我们已经看到大约三年前有一个 GitHub 问题提到了同样的问题,并且有一些提交来解决这个问题,但不知何故它仍然对我们不起作用。
所以现在我们不确定我们的实施是否有误,或者是否有其他原因阻止我们更改时区。
But setting the timezone variable in either of those files only
changes the name of the timezone next to the clock to Europe/Berlin
but neither the time of the clock
nor the time of the last userlogin
change, they still show the UTC time.
基于 Web 的时钟的值是否与容器内 date
报告的值匹配?您需要 post 实际值,以便我们了解发生了什么。
如果它们不匹配,则可能意味着容器未针对本地时区进行适当配置。
解决方案是在 docker-compose.yml
中设置 KIWI_USE_TZ: "True"
。您也可以在设置文件中设置 USE_TZ = True
。
我们目前正在尝试使用 docker 将 KiwiTCMS 实施到我们的工作流程中。我们已经看到,应该可以通过更改设置中的环境变量 KIWI_TIME_ZONE
或 TIME_ZONE
来更改 KiwiTCMS 中的时区。
因此,我们尝试将 docker-compose.yml
内的环境变量设置为 KIWI_TIME_ZONE: Europe/Berlin
或将设置文件添加为卷 TIME_ZONE = 'Europe/Berlin'
.
我们已将名为 default_config.py
的设置文件添加到 docker-compose.yml
中,如下所示:
volumes:
- ./my_settings_dir/default_config.py:/venv/lib64/python3.8/site-packages/tcms_settings_dir/default_config.py
该卷看起来已正确实施,因为我们在同一文件中更改的其他设置有效。但是在这些文件中的任何一个中设置时区变量只会将时钟旁边的时区名称更改为 Europe/Berlin
但时钟时间和上次用户登录时间都不会更改,它们仍然显示 UTC 时间。
作为 运行 docker 容器的服务器时间和两个 docker 容器(DB 和 Kiwi)的时间设置为 Europe/Berlin
以便应该不是问题。
我们已经看到大约三年前有一个 GitHub 问题提到了同样的问题,并且有一些提交来解决这个问题,但不知何故它仍然对我们不起作用。
所以现在我们不确定我们的实施是否有误,或者是否有其他原因阻止我们更改时区。
But setting the timezone variable in either of those files only changes the name of the timezone next to the clock to Europe/Berlin but neither the time of the clock nor the time of the last userlogin change, they still show the UTC time.
基于 Web 的时钟的值是否与容器内 date
报告的值匹配?您需要 post 实际值,以便我们了解发生了什么。
如果它们不匹配,则可能意味着容器未针对本地时区进行适当配置。
解决方案是在 docker-compose.yml
中设置 KIWI_USE_TZ: "True"
。您也可以在设置文件中设置 USE_TZ = True
。