Search code examples
kiwi-tcms

Setting Timezone in KiwiTCMS


We are currently trying to implement KiwiTCMS into our workflow with docker. We've seen that it should be possible to change the timezone in KiwiTCMS by either changing the environment variable KIWI_TIME_ZONE or TIME_ZONE in the settings.

We therefore tried either setting the environment variable inside the docker-compose.yml as KIWI_TIME_ZONE: Europe/Berlin or adding a settings file as a volume where TIME_ZONE = 'Europe/Berlin'.

We've added the settingsfile called default_config.py into the docker-compose.yml as follows:

volumes:
    - ./my_settings_dir/default_config.py:/venv/lib64/python3.8/site-packages/tcms_settings_dir/default_config.py

The volume looks to be implemented correctly because other settings we change inside the same file work. 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.

The time of the server that is running the docker containers and the time of both docker containers (DB and Kiwi) is set to Europe/Berlin so that shouldn't be the issue.

We've seen that there was a GitHub issue around three years ago that mentioned the same problem and there were a few commits to fix that issue but somehow it still doesn't work for us.

So now we're not sure if our implementation is wrong or if it's something else that prevents us from changing the timezone.


Solution

  • We resolved the problem, thanks to eddywu on GitHub.

    The solution was to set KIWI_USE_TZ: "True" in the docker-compose.yml. You could probably also set USE_TZ = True in the settings file.