We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Starting up Kolibri Development Server
### Observed behavior

Trying to run the Kolobri Development Server from Ubuntu Bash on Windows, but it raises a ValueError for incorrect timezone (local).

### Expected behavior

Should start up the Kolibri server on local machine.

### Errors and logs

Relevant errors and tracebacks from:

*virtual environment command line:
```
Traceback (most recent call last):
  File "/home/alan/.venvs/kolibri/bin/kolibri", line 11, in <module>
    load_entry_point('kolibri', 'console_scripts', 'kolibri')()
  File "/home/alan/Kolibri1/kolibri/kolibri/utils/cli.py", line 607, in main
    initialize(debug=debug)
  File "/home/alan/Kolibri1/kolibri/kolibri/utils/cli.py", line 176, in initialize
    django.setup()
  File "/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
    self._setup(name)
  File "/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/conf/__init__.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/conf/__init__.py", line 138, in __init__
    raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
ValueError: Incorrect timezone setting: local

```

### Steps to reproduce

Run command to start up Kolibri Development server. 

kolibri --debug manage devserver --webpack

### Context

* Kolibri version: Develop Branch
* Operating system: Ubuntu Bash for Windows

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `kolibri/deployment/default/settings/base.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """
3 Django settings for kolibri project.
4 
5 For more information on this file, see
6 https://docs.djangoproject.com/en/1.9/topics/settings/
7 
8 For the full list of settings and their values, see
9 https://docs.djangoproject.com/en/1.9/ref/settings/
10 """
11 from __future__ import absolute_import, print_function, unicode_literals
12 
13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14 import os
15 
16 # import kolibri, so we can get the path to the module.
17 import kolibri
18 # we load other utilities related to i18n
19 # This is essential! We load the kolibri conf INSIDE the Django conf
20 from kolibri.utils import conf, i18n
21 from tzlocal import get_localzone
22 
23 KOLIBRI_MODULE_PATH = os.path.dirname(kolibri.__file__)
24 
25 BASE_DIR = os.path.abspath(os.path.dirname(__name__))
26 
27 KOLIBRI_HOME = os.environ['KOLIBRI_HOME']
28 
29 KOLIBRI_CORE_JS_NAME = 'kolibriGlobal'
30 
31 LOCALE_PATHS = [
32     os.path.join(KOLIBRI_MODULE_PATH, "locale"),
33 ]
34 
35 # Quick-start development settings - unsuitable for production
36 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
37 
38 # SECURITY WARNING: keep the secret key used in production secret!
39 SECRET_KEY = 'f@ey3)y^03r9^@mou97apom*+c1m#b1!cwbm50^s4yk72xce27'
40 
41 # SECURITY WARNING: don't run with debug turned on in production!
42 DEBUG = False
43 
44 ALLOWED_HOSTS = ['*']
45 
46 # Application definition
47 
48 INSTALLED_APPS = [
49     'kolibri.core',
50     'django.contrib.admin',
51     'django.contrib.auth',
52     'django.contrib.contenttypes',
53     'django.contrib.sessions',
54     'django.contrib.messages',
55     'django.contrib.staticfiles',
56     'kolibri.auth.apps.KolibriAuthConfig',
57     'kolibri.content',
58     'kolibri.logger',
59     'kolibri.tasks.apps.KolibriTasksConfig',
60     'kolibri.core.webpack',
61     'kolibri.core.exams',
62     'kolibri.core.device',
63     'kolibri.core.discovery',
64     'rest_framework',
65     'django_js_reverse',
66     'jsonfield',
67     'morango',
68 ] + conf.config['INSTALLED_APPS']
69 
70 # Add in the external plugins' locale paths. Our frontend messages depends
71 # specifically on the value of LOCALE_PATHS to find its catalog files.
72 LOCALE_PATHS += [
73     i18n.get_installed_app_locale_path(app) for app in INSTALLED_APPS
74     if i18n.is_external_plugin(app)
75 ]
76 
77 MIDDLEWARE_CLASSES = (
78     'django.contrib.sessions.middleware.SessionMiddleware',
79     'kolibri.core.device.middleware.KolibriLocaleMiddleware',
80     'django.middleware.common.CommonMiddleware',
81     'django.middleware.csrf.CsrfViewMiddleware',
82     'kolibri.plugins.setup_wizard.middleware.SetupWizardMiddleware',
83     'kolibri.auth.middleware.CustomAuthenticationMiddleware',
84     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
85     'django.contrib.messages.middleware.MessageMiddleware',
86     'django.middleware.clickjacking.XFrameOptionsMiddleware',
87     'django.middleware.security.SecurityMiddleware',
88 )
89 
90 QUEUE_JOB_STORAGE_PATH = os.path.join(KOLIBRI_HOME, "job_storage.sqlite3")
91 
92 ROOT_URLCONF = 'kolibri.deployment.default.urls'
93 
94 TEMPLATES = [
95     {
96         'BACKEND': 'django.template.backends.django.DjangoTemplates',
97         'DIRS': [],
98         'APP_DIRS': True,
99         'OPTIONS': {
100             'context_processors': [
101                 'django.template.context_processors.debug',
102                 'django.template.context_processors.request',
103                 'django.contrib.auth.context_processors.auth',
104                 'django.contrib.messages.context_processors.messages',
105                 'kolibri.core.context_processors.custom_context_processor.return_session',
106             ],
107         },
108     },
109 ]
110 
111 WSGI_APPLICATION = 'kolibri.deployment.default.wsgi.application'
112 
113 
114 # Database
115 # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
116 
117 DATABASES = {
118     'default': {
119         'ENGINE': 'django.db.backends.sqlite3',
120         'NAME': os.path.join(KOLIBRI_HOME, 'db.sqlite3'),
121         'OPTIONS': {
122             'timeout': 100,
123         }
124     },
125 }
126 
127 # Content directories and URLs for channel metadata and content files
128 
129 # Directory and URL for storing content databases for channel data
130 CONTENT_DATABASE_DIR = os.path.join(KOLIBRI_HOME, 'content', 'databases')
131 if not os.path.exists(CONTENT_DATABASE_DIR):
132     os.makedirs(CONTENT_DATABASE_DIR)
133 
134 # Directory and URL for storing de-duped content files for all channels
135 CONTENT_STORAGE_DIR = os.path.join(KOLIBRI_HOME, 'content', 'storage')
136 if not os.path.exists(CONTENT_STORAGE_DIR):
137     os.makedirs(CONTENT_STORAGE_DIR)
138 
139 # Base default URL for downloading content from an online server
140 CENTRAL_CONTENT_DOWNLOAD_BASE_URL = "http://studio.learningequality.org"
141 
142 # Internationalization
143 # https://docs.djangoproject.com/en/1.9/topics/i18n/
144 
145 LANGUAGES = [
146     ('en', 'English'),
147     ('sw-tz', 'Kiswahili'),
148     ('es-es', 'Español'),
149     ('es-mx', 'Español (México)'),
150     ('fr-fr', 'Français'),
151     ('pt-pt', 'Português'),
152     ('hi-in', 'हिंदी'),
153     ('ar-eg', 'العَرَبِيَّة‎‎')
154 ]
155 
156 LANGUAGE_CODE = conf.config.get("LANGUAGE_CODE") or "en"
157 
158 TIME_ZONE = get_localzone().zone
159 
160 USE_I18N = True
161 
162 USE_L10N = True
163 
164 USE_TZ = True
165 
166 # Static files (CSS, JavaScript, Images)
167 # https://docs.djangoproject.com/en/1.9/howto/static-files/
168 
169 STATIC_URL = '/static/'
170 STATIC_ROOT = os.path.join(KOLIBRI_HOME, "static")
171 
172 # https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-LOGGING
173 # https://docs.djangoproject.com/en/1.9/topics/logging/
174 
175 LOGGING = {
176     'version': 1,
177     'disable_existing_loggers': False,
178     'formatters': {
179         'verbose': {
180             'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
181         },
182         'simple': {
183             'format': '%(levelname)s %(message)s'
184         },
185         'simple_date': {
186             'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
187         },
188         'color': {
189             '()': 'colorlog.ColoredFormatter',
190             'format': '%(log_color)s%(levelname)-8s %(message)s',
191             'log_colors': {
192                 'DEBUG': 'bold_black',
193                 'INFO': 'white',
194                 'WARNING': 'yellow',
195                 'ERROR': 'red',
196                 'CRITICAL': 'bold_red',
197             },
198         }
199     },
200     'filters': {
201         'require_debug_true': {
202             '()': 'django.utils.log.RequireDebugTrue',
203         },
204         'require_debug_false': {
205             '()': 'django.utils.log.RequireDebugFalse',
206         },
207     },
208     'handlers': {
209         'console': {
210             'level': 'INFO',
211             'class': 'logging.StreamHandler',
212             'formatter': 'color'
213         },
214         'mail_admins': {
215             'level': 'ERROR',
216             'class': 'django.utils.log.AdminEmailHandler',
217             'filters': ['require_debug_false'],
218         },
219         'request_debug': {
220             'level': 'ERROR',
221             'class': 'logging.StreamHandler',
222             'formatter': 'color',
223             'filters': ['require_debug_true'],
224         },
225         'file_debug': {
226             'level': 'DEBUG',
227             'filters': ['require_debug_true'],
228             'class': 'logging.FileHandler',
229             'filename': os.path.join(KOLIBRI_HOME, 'debug.log'),
230             'formatter': 'simple_date',
231         },
232         'file': {
233             'level': 'INFO',
234             'filters': [],
235             'class': 'logging.FileHandler',
236             'filename': os.path.join(KOLIBRI_HOME, 'kolibri.log'),
237             'formatter': 'simple_date',
238         },
239     },
240     'loggers': {
241         'django': {
242             'handlers': ['console', 'file'],
243             'propagate': True,
244         },
245         'django.request': {
246             'handlers': ['mail_admins', 'file', 'request_debug'],
247             'level': 'ERROR',
248             'propagate': False,
249         },
250         'kolibri': {
251             'handlers': ['console', 'mail_admins', 'file', 'file_debug'],
252             'level': 'INFO',
253         }
254     }
255 }
256 
257 
258 # Customizing Django auth system
259 # https://docs.djangoproject.com/en/1.9/topics/auth/customizing/
260 
261 AUTH_USER_MODEL = 'kolibriauth.FacilityUser'
262 
263 AUTHENTICATION_BACKENDS = ['kolibri.auth.backends.FacilityUserBackend']
264 
265 
266 # Django REST Framework
267 # http://www.django-rest-framework.org/api-guide/settings/
268 
269 REST_FRAMEWORK = {
270     "UNAUTHENTICATED_USER": "kolibri.auth.models.KolibriAnonymousUser",
271     'DEFAULT_RENDERER_CLASSES': (
272         'rest_framework.renderers.JSONRenderer',
273         'rest_framework.renderers.BrowsableAPIRenderer',
274         'rest_framework_csv.renderers.CSVRenderer',
275     ),
276 }
277 
278 # System warnings to disable
279 # see https://docs.djangoproject.com/en/1.9/ref/settings/#silenced-system-checks
280 SILENCED_SYSTEM_CHECKS = ["auth.W004"]
281 
282 # Configuration for Django JS Reverse
283 # https://github.com/ierror/django-js-reverse#options
284 
285 JS_REVERSE_JS_VAR_NAME = 'kolibriUrls'
286 
287 JS_REVERSE_EXCLUDE_NAMESPACES = ['admin', ]
288 
289 ENABLE_DATA_BOOTSTRAPPING = True
290
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/kolibri/deployment/default/settings/base.py b/kolibri/deployment/default/settings/base.py
--- a/kolibri/deployment/default/settings/base.py
+++ b/kolibri/deployment/default/settings/base.py
@@ -13,6 +13,8 @@
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
 import os
 
+import pytz
+
 # import kolibri, so we can get the path to the module.
 import kolibri
 # we load other utilities related to i18n
@@ -155,7 +157,18 @@
 
 LANGUAGE_CODE = conf.config.get("LANGUAGE_CODE") or "en"
 
-TIME_ZONE = get_localzone().zone
+try:
+    TIME_ZONE = get_localzone().zone
+except pytz.UnknownTimeZoneError:
+    # Do not fail at this point because a timezone was not
+    # detected.
+    TIME_ZONE = pytz.utc.zone
+
+# Fixes https://github.com/regebro/tzlocal/issues/44
+# tzlocal 1.4 returns 'local' if unable to detect the timezone,
+# and this TZ id is invalid
+if TIME_ZONE == "local":
+    TIME_ZONE = pytz.utc.zone
 
 USE_I18N = True

{"golden_diff": "diff --git a/kolibri/deployment/default/settings/base.py b/kolibri/deployment/default/settings/base.py\n--- a/kolibri/deployment/default/settings/base.py\n+++ b/kolibri/deployment/default/settings/base.py\n@@ -13,6 +13,8 @@\n # Build paths inside the project like this: os.path.join(BASE_DIR, ...)\n import os\n \n+import pytz\n+\n # import kolibri, so we can get the path to the module.\n import kolibri\n # we load other utilities related to i18n\n@@ -155,7 +157,18 @@\n \n LANGUAGE_CODE = conf.config.get(\"LANGUAGE_CODE\") or \"en\"\n \n-TIME_ZONE = get_localzone().zone\n+try:\n+    TIME_ZONE = get_localzone().zone\n+except pytz.UnknownTimeZoneError:\n+    # Do not fail at this point because a timezone was not\n+    # detected.\n+    TIME_ZONE = pytz.utc.zone\n+\n+# Fixes https://github.com/regebro/tzlocal/issues/44\n+# tzlocal 1.4 returns 'local' if unable to detect the timezone,\n+# and this TZ id is invalid\n+if TIME_ZONE == \"local\":\n+    TIME_ZONE = pytz.utc.zone\n \n USE_I18N = True\n", "issue": "Starting up Kolibri Development Server\n### Observed behavior\r\n\r\nTrying to run the Kolobri Development Server from Ubuntu Bash on Windows, but it raises a ValueError for incorrect timezone (local).\r\n\r\n### Expected behavior\r\n\r\nShould start up the Kolibri server on local machine.\r\n\r\n### Errors and logs\r\n\r\nRelevant errors and tracebacks from:\r\n\r\n*virtual environment command line:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/alan/.venvs/kolibri/bin/kolibri\", line 11, in <module>\r\n    load_entry_point('kolibri', 'console_scripts', 'kolibri')()\r\n  File \"/home/alan/Kolibri1/kolibri/kolibri/utils/cli.py\", line 607, in main\r\n    initialize(debug=debug)\r\n  File \"/home/alan/Kolibri1/kolibri/kolibri/utils/cli.py\", line 176, in initialize\r\n    django.setup()\r\n  File \"/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/__init__.py\", line 17, in setup\r\n    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)\r\n  File \"/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/conf/__init__.py\", line 55, in __getattr__\r\n    self._setup(name)\r\n  File \"/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/conf/__init__.py\", line 43, in _setup\r\n    self._wrapped = Settings(settings_module)\r\n  File \"/home/alan/.venvs/kolibri/local/lib/python2.7/site-packages/django/conf/__init__.py\", line 138, in __init__\r\n    raise ValueError(\"Incorrect timezone setting: %s\" % self.TIME_ZONE)\r\nValueError: Incorrect timezone setting: local\r\n\r\n```\r\n\r\n### Steps to reproduce\r\n\r\nRun command to start up Kolibri Development server. \r\n\r\nkolibri --debug manage devserver --webpack\r\n\r\n### Context\r\n\r\n* Kolibri version: Develop Branch\r\n* Operating system: Ubuntu Bash for Windows\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDjango settings for kolibri project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.9/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.9/ref/settings/\n\"\"\"\nfrom __future__ import absolute_import, print_function, unicode_literals\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nimport os\n\n# import kolibri, so we can get the path to the module.\nimport kolibri\n# we load other utilities related to i18n\n# This is essential! We load the kolibri conf INSIDE the Django conf\nfrom kolibri.utils import conf, i18n\nfrom tzlocal import get_localzone\n\nKOLIBRI_MODULE_PATH = os.path.dirname(kolibri.__file__)\n\nBASE_DIR = os.path.abspath(os.path.dirname(__name__))\n\nKOLIBRI_HOME = os.environ['KOLIBRI_HOME']\n\nKOLIBRI_CORE_JS_NAME = 'kolibriGlobal'\n\nLOCALE_PATHS = [\n    os.path.join(KOLIBRI_MODULE_PATH, \"locale\"),\n]\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = 'f@ey3)y^03r9^@mou97apom*+c1m#b1!cwbm50^s4yk72xce27'\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False\n\nALLOWED_HOSTS = ['*']\n\n# Application definition\n\nINSTALLED_APPS = [\n    'kolibri.core',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'kolibri.auth.apps.KolibriAuthConfig',\n    'kolibri.content',\n    'kolibri.logger',\n    'kolibri.tasks.apps.KolibriTasksConfig',\n    'kolibri.core.webpack',\n    'kolibri.core.exams',\n    'kolibri.core.device',\n    'kolibri.core.discovery',\n    'rest_framework',\n    'django_js_reverse',\n    'jsonfield',\n    'morango',\n] + conf.config['INSTALLED_APPS']\n\n# Add in the external plugins' locale paths. Our frontend messages depends\n# specifically on the value of LOCALE_PATHS to find its catalog files.\nLOCALE_PATHS += [\n    i18n.get_installed_app_locale_path(app) for app in INSTALLED_APPS\n    if i18n.is_external_plugin(app)\n]\n\nMIDDLEWARE_CLASSES = (\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'kolibri.core.device.middleware.KolibriLocaleMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'kolibri.plugins.setup_wizard.middleware.SetupWizardMiddleware',\n    'kolibri.auth.middleware.CustomAuthenticationMiddleware',\n    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    'django.middleware.security.SecurityMiddleware',\n)\n\nQUEUE_JOB_STORAGE_PATH = os.path.join(KOLIBRI_HOME, \"job_storage.sqlite3\")\n\nROOT_URLCONF = 'kolibri.deployment.default.urls'\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n                'kolibri.core.context_processors.custom_context_processor.return_session',\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = 'kolibri.deployment.default.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/1.9/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(KOLIBRI_HOME, 'db.sqlite3'),\n        'OPTIONS': {\n            'timeout': 100,\n        }\n    },\n}\n\n# Content directories and URLs for channel metadata and content files\n\n# Directory and URL for storing content databases for channel data\nCONTENT_DATABASE_DIR = os.path.join(KOLIBRI_HOME, 'content', 'databases')\nif not os.path.exists(CONTENT_DATABASE_DIR):\n    os.makedirs(CONTENT_DATABASE_DIR)\n\n# Directory and URL for storing de-duped content files for all channels\nCONTENT_STORAGE_DIR = os.path.join(KOLIBRI_HOME, 'content', 'storage')\nif not os.path.exists(CONTENT_STORAGE_DIR):\n    os.makedirs(CONTENT_STORAGE_DIR)\n\n# Base default URL for downloading content from an online server\nCENTRAL_CONTENT_DOWNLOAD_BASE_URL = \"http://studio.learningequality.org\"\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.9/topics/i18n/\n\nLANGUAGES = [\n    ('en', 'English'),\n    ('sw-tz', 'Kiswahili'),\n    ('es-es', 'Espa\u00f1ol'),\n    ('es-mx', 'Espa\u00f1ol (M\u00e9xico)'),\n    ('fr-fr', 'Fran\u00e7ais'),\n    ('pt-pt', 'Portugu\u00eas'),\n    ('hi-in', '\u0939\u093f\u0902\u0926\u0940'),\n    ('ar-eg', '\u0627\u0644\u0639\u064e\u0631\u064e\u0628\u0650\u064a\u064e\u0651\u0629\u200e\u200e')\n]\n\nLANGUAGE_CODE = conf.config.get(\"LANGUAGE_CODE\") or \"en\"\n\nTIME_ZONE = get_localzone().zone\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.9/howto/static-files/\n\nSTATIC_URL = '/static/'\nSTATIC_ROOT = os.path.join(KOLIBRI_HOME, \"static\")\n\n# https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-LOGGING\n# https://docs.djangoproject.com/en/1.9/topics/logging/\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'\n        },\n        'simple': {\n            'format': '%(levelname)s %(message)s'\n        },\n        'simple_date': {\n            'format': '%(levelname)s %(asctime)s %(module)s %(message)s'\n        },\n        'color': {\n            '()': 'colorlog.ColoredFormatter',\n            'format': '%(log_color)s%(levelname)-8s %(message)s',\n            'log_colors': {\n                'DEBUG': 'bold_black',\n                'INFO': 'white',\n                'WARNING': 'yellow',\n                'ERROR': 'red',\n                'CRITICAL': 'bold_red',\n            },\n        }\n    },\n    'filters': {\n        'require_debug_true': {\n            '()': 'django.utils.log.RequireDebugTrue',\n        },\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse',\n        },\n    },\n    'handlers': {\n        'console': {\n            'level': 'INFO',\n            'class': 'logging.StreamHandler',\n            'formatter': 'color'\n        },\n        'mail_admins': {\n            'level': 'ERROR',\n            'class': 'django.utils.log.AdminEmailHandler',\n            'filters': ['require_debug_false'],\n        },\n        'request_debug': {\n            'level': 'ERROR',\n            'class': 'logging.StreamHandler',\n            'formatter': 'color',\n            'filters': ['require_debug_true'],\n        },\n        'file_debug': {\n            'level': 'DEBUG',\n            'filters': ['require_debug_true'],\n            'class': 'logging.FileHandler',\n            'filename': os.path.join(KOLIBRI_HOME, 'debug.log'),\n            'formatter': 'simple_date',\n        },\n        'file': {\n            'level': 'INFO',\n            'filters': [],\n            'class': 'logging.FileHandler',\n            'filename': os.path.join(KOLIBRI_HOME, 'kolibri.log'),\n            'formatter': 'simple_date',\n        },\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['console', 'file'],\n            'propagate': True,\n        },\n        'django.request': {\n            'handlers': ['mail_admins', 'file', 'request_debug'],\n            'level': 'ERROR',\n            'propagate': False,\n        },\n        'kolibri': {\n            'handlers': ['console', 'mail_admins', 'file', 'file_debug'],\n            'level': 'INFO',\n        }\n    }\n}\n\n\n# Customizing Django auth system\n# https://docs.djangoproject.com/en/1.9/topics/auth/customizing/\n\nAUTH_USER_MODEL = 'kolibriauth.FacilityUser'\n\nAUTHENTICATION_BACKENDS = ['kolibri.auth.backends.FacilityUserBackend']\n\n\n# Django REST Framework\n# http://www.django-rest-framework.org/api-guide/settings/\n\nREST_FRAMEWORK = {\n    \"UNAUTHENTICATED_USER\": \"kolibri.auth.models.KolibriAnonymousUser\",\n    'DEFAULT_RENDERER_CLASSES': (\n        'rest_framework.renderers.JSONRenderer',\n        'rest_framework.renderers.BrowsableAPIRenderer',\n        'rest_framework_csv.renderers.CSVRenderer',\n    ),\n}\n\n# System warnings to disable\n# see https://docs.djangoproject.com/en/1.9/ref/settings/#silenced-system-checks\nSILENCED_SYSTEM_CHECKS = [\"auth.W004\"]\n\n# Configuration for Django JS Reverse\n# https://github.com/ierror/django-js-reverse#options\n\nJS_REVERSE_JS_VAR_NAME = 'kolibriUrls'\n\nJS_REVERSE_EXCLUDE_NAMESPACES = ['admin', ]\n\nENABLE_DATA_BOOTSTRAPPING = True\n", "path": "kolibri/deployment/default/settings/base.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDjango settings for kolibri project.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.9/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.9/ref/settings/\n\"\"\"\nfrom __future__ import absolute_import, print_function, unicode_literals\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nimport os\n\nimport pytz\n\n# import kolibri, so we can get the path to the module.\nimport kolibri\n# we load other utilities related to i18n\n# This is essential! We load the kolibri conf INSIDE the Django conf\nfrom kolibri.utils import conf, i18n\nfrom tzlocal import get_localzone\n\nKOLIBRI_MODULE_PATH = os.path.dirname(kolibri.__file__)\n\nBASE_DIR = os.path.abspath(os.path.dirname(__name__))\n\nKOLIBRI_HOME = os.environ['KOLIBRI_HOME']\n\nKOLIBRI_CORE_JS_NAME = 'kolibriGlobal'\n\nLOCALE_PATHS = [\n    os.path.join(KOLIBRI_MODULE_PATH, \"locale\"),\n]\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = 'f@ey3)y^03r9^@mou97apom*+c1m#b1!cwbm50^s4yk72xce27'\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False\n\nALLOWED_HOSTS = ['*']\n\n# Application definition\n\nINSTALLED_APPS = [\n    'kolibri.core',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'kolibri.auth.apps.KolibriAuthConfig',\n    'kolibri.content',\n    'kolibri.logger',\n    'kolibri.tasks.apps.KolibriTasksConfig',\n    'kolibri.core.webpack',\n    'kolibri.core.exams',\n    'kolibri.core.device',\n    'kolibri.core.discovery',\n    'rest_framework',\n    'django_js_reverse',\n    'jsonfield',\n    'morango',\n] + conf.config['INSTALLED_APPS']\n\n# Add in the external plugins' locale paths. Our frontend messages depends\n# specifically on the value of LOCALE_PATHS to find its catalog files.\nLOCALE_PATHS += [\n    i18n.get_installed_app_locale_path(app) for app in INSTALLED_APPS\n    if i18n.is_external_plugin(app)\n]\n\nMIDDLEWARE_CLASSES = (\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'kolibri.core.device.middleware.KolibriLocaleMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    'django.middleware.csrf.CsrfViewMiddleware',\n    'kolibri.plugins.setup_wizard.middleware.SetupWizardMiddleware',\n    'kolibri.auth.middleware.CustomAuthenticationMiddleware',\n    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    'django.middleware.security.SecurityMiddleware',\n)\n\nQUEUE_JOB_STORAGE_PATH = os.path.join(KOLIBRI_HOME, \"job_storage.sqlite3\")\n\nROOT_URLCONF = 'kolibri.deployment.default.urls'\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n                'kolibri.core.context_processors.custom_context_processor.return_session',\n            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = 'kolibri.deployment.default.wsgi.application'\n\n\n# Database\n# https://docs.djangoproject.com/en/1.9/ref/settings/#databases\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.sqlite3',\n        'NAME': os.path.join(KOLIBRI_HOME, 'db.sqlite3'),\n        'OPTIONS': {\n            'timeout': 100,\n        }\n    },\n}\n\n# Content directories and URLs for channel metadata and content files\n\n# Directory and URL for storing content databases for channel data\nCONTENT_DATABASE_DIR = os.path.join(KOLIBRI_HOME, 'content', 'databases')\nif not os.path.exists(CONTENT_DATABASE_DIR):\n    os.makedirs(CONTENT_DATABASE_DIR)\n\n# Directory and URL for storing de-duped content files for all channels\nCONTENT_STORAGE_DIR = os.path.join(KOLIBRI_HOME, 'content', 'storage')\nif not os.path.exists(CONTENT_STORAGE_DIR):\n    os.makedirs(CONTENT_STORAGE_DIR)\n\n# Base default URL for downloading content from an online server\nCENTRAL_CONTENT_DOWNLOAD_BASE_URL = \"http://studio.learningequality.org\"\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.9/topics/i18n/\n\nLANGUAGES = [\n    ('en', 'English'),\n    ('sw-tz', 'Kiswahili'),\n    ('es-es', 'Espa\u00f1ol'),\n    ('es-mx', 'Espa\u00f1ol (M\u00e9xico)'),\n    ('fr-fr', 'Fran\u00e7ais'),\n    ('pt-pt', 'Portugu\u00eas'),\n    ('hi-in', '\u0939\u093f\u0902\u0926\u0940'),\n    ('ar-eg', '\u0627\u0644\u0639\u064e\u0631\u064e\u0628\u0650\u064a\u064e\u0651\u0629\u200e\u200e')\n]\n\nLANGUAGE_CODE = conf.config.get(\"LANGUAGE_CODE\") or \"en\"\n\ntry:\n    TIME_ZONE = get_localzone().zone\nexcept pytz.UnknownTimeZoneError:\n    # Do not fail at this point because a timezone was not\n    # detected.\n    TIME_ZONE = pytz.utc.zone\n\n# Fixes https://github.com/regebro/tzlocal/issues/44\n# tzlocal 1.4 returns 'local' if unable to detect the timezone,\n# and this TZ id is invalid\nif TIME_ZONE == \"local\":\n    TIME_ZONE = pytz.utc.zone\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.9/howto/static-files/\n\nSTATIC_URL = '/static/'\nSTATIC_ROOT = os.path.join(KOLIBRI_HOME, \"static\")\n\n# https://docs.djangoproject.com/en/1.9/ref/settings/#std:setting-LOGGING\n# https://docs.djangoproject.com/en/1.9/topics/logging/\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'formatters': {\n        'verbose': {\n            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'\n        },\n        'simple': {\n            'format': '%(levelname)s %(message)s'\n        },\n        'simple_date': {\n            'format': '%(levelname)s %(asctime)s %(module)s %(message)s'\n        },\n        'color': {\n            '()': 'colorlog.ColoredFormatter',\n            'format': '%(log_color)s%(levelname)-8s %(message)s',\n            'log_colors': {\n                'DEBUG': 'bold_black',\n                'INFO': 'white',\n                'WARNING': 'yellow',\n                'ERROR': 'red',\n                'CRITICAL': 'bold_red',\n            },\n        }\n    },\n    'filters': {\n        'require_debug_true': {\n            '()': 'django.utils.log.RequireDebugTrue',\n        },\n        'require_debug_false': {\n            '()': 'django.utils.log.RequireDebugFalse',\n        },\n    },\n    'handlers': {\n        'console': {\n            'level': 'INFO',\n            'class': 'logging.StreamHandler',\n            'formatter': 'color'\n        },\n        'mail_admins': {\n            'level': 'ERROR',\n            'class': 'django.utils.log.AdminEmailHandler',\n            'filters': ['require_debug_false'],\n        },\n        'request_debug': {\n            'level': 'ERROR',\n            'class': 'logging.StreamHandler',\n            'formatter': 'color',\n            'filters': ['require_debug_true'],\n        },\n        'file_debug': {\n            'level': 'DEBUG',\n            'filters': ['require_debug_true'],\n            'class': 'logging.FileHandler',\n            'filename': os.path.join(KOLIBRI_HOME, 'debug.log'),\n            'formatter': 'simple_date',\n        },\n        'file': {\n            'level': 'INFO',\n            'filters': [],\n            'class': 'logging.FileHandler',\n            'filename': os.path.join(KOLIBRI_HOME, 'kolibri.log'),\n            'formatter': 'simple_date',\n        },\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['console', 'file'],\n            'propagate': True,\n        },\n        'django.request': {\n            'handlers': ['mail_admins', 'file', 'request_debug'],\n            'level': 'ERROR',\n            'propagate': False,\n        },\n        'kolibri': {\n            'handlers': ['console', 'mail_admins', 'file', 'file_debug'],\n            'level': 'INFO',\n        }\n    }\n}\n\n\n# Customizing Django auth system\n# https://docs.djangoproject.com/en/1.9/topics/auth/customizing/\n\nAUTH_USER_MODEL = 'kolibriauth.FacilityUser'\n\nAUTHENTICATION_BACKENDS = ['kolibri.auth.backends.FacilityUserBackend']\n\n\n# Django REST Framework\n# http://www.django-rest-framework.org/api-guide/settings/\n\nREST_FRAMEWORK = {\n    \"UNAUTHENTICATED_USER\": \"kolibri.auth.models.KolibriAnonymousUser\",\n    'DEFAULT_RENDERER_CLASSES': (\n        'rest_framework.renderers.JSONRenderer',\n        'rest_framework.renderers.BrowsableAPIRenderer',\n        'rest_framework_csv.renderers.CSVRenderer',\n    ),\n}\n\n# System warnings to disable\n# see https://docs.djangoproject.com/en/1.9/ref/settings/#silenced-system-checks\nSILENCED_SYSTEM_CHECKS = [\"auth.W004\"]\n\n# Configuration for Django JS Reverse\n# https://github.com/ierror/django-js-reverse#options\n\nJS_REVERSE_JS_VAR_NAME = 'kolibriUrls'\n\nJS_REVERSE_EXCLUDE_NAMESPACES = ['admin', ]\n\nENABLE_DATA_BOOTSTRAPPING = True\n", "path": "kolibri/deployment/default/settings/base.py"}]}