nephila / djangocms-installer

Console wizard to bootstrap django CMS projects

Home Page:https://djangocms-installer.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Djangocms failed in install because timezone incorrect

lukasgarcya opened this issue · comments

I try install the Django CMS and I receive the error: ValueError: Incorrect timezone setting: local
The installation has failed.
error djangocms

@lukasgarcya commit f799503 should fix the issue

I noticed that the problem is due to the installer does not display the options for installation. This simply trying to install straight.

New error because the installer does not display options for installation.
error djangocms 2

From version 0.9 batch mode is the default. You can resume the wizard mode by adding -w option in the command line. What's your system timezone BTW?

My system timezone is UTC -03:00.

I meant the content of /etc/timezone file

On 2 October 2016 23:08:28 CEST, "Lucas Garcia de Araújo" notifications@github.com wrote:

My system timezone is UTC -03:00.

You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#291 (comment)

This file is empty.

This is the cause of the issue, then. I will investigate tomorrow reproducing the issue with an empty file (hopefully). Thanks for the additional information

On 2 October 2016 23:13:10 CEST, "Lucas Garcia de Araújo" notifications@github.com wrote:

This file is empty.

You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#291 (comment)

Hi @lukasgarcya,
Just a little background regarding the no options change.

In the past, our default was for the installer to be interactive.
Based on user feedback we've realized that this can be a bit confusing to newcomers who want to get up and running quickly. As a result we've made the non-interactive option the default but you can still use get the interactive prompts by passing the -w flag.

So far I've been unable to reproduce the issue
However, installer 0.9.2 ships with a workaround that should prevent any error like this fallbacking to UTC

I had this issue today with a fresh pip install of djangocms-installer. I traced the problem to the "tzlocal" package, which attempts to determine the local timezone. The tzlocal.get_localzone() function for *nix systems goes through a series of checks to try to find the timezone setting. For my system, which is running Fedora 20, the method it fell back to was to look at the path of "/etc/localtime", which is apparently usually a symlink on systemd-based systems. On my system it was not a symlink, but rather a copy of the zoneinfo file from /usr/share/zoneinfo, so it could not find a timezone from the path data and was therefore falling back to a timezone called "local", which gets stuffed into the "settings.py" file that djangocms creates. django's manage.py then pukes on the "local" setting of the timezone since it does not exist in /usr/share/zoneinfo. So, if you're having problems with the timezone, check the search order out for tzlocal.get_localzone() function out for your platform. I fixed the problem for my platform by replacing the /etc/localtime file with a symlink to the correct file in /usr/share/zoneinfo, but the problem seems like it could also be fixed temporarily by setting the "TZ" env variable to the correct timezone.

@jbarrett1205 as a workaround you can also use the "timezone" parameter https://djangocms-installer.readthedocs.io/en/latest/reference.html#wizard-arguments to provide a specific timezone, ignoring the autodetection

I'm closing this.
djangocms installer provides: