# -*- coding: utf-8 -*-
"""Django settings for kitsune project."""

import logging
import os
import platform
import re
from datetime import date

from bundles import PIPELINE_CSS, PIPELINE_JS
from kitsune.lib.sumo_locales import LOCALES

DEBUG = True
TEMPLATE_DEBUG = DEBUG
STAGE = False

LOG_LEVEL = logging.INFO
SYSLOG_TAG = 'http_sumo_app'

# Repository directory.
ROOT = os.path.dirname(os.path.dirname(__file__))

# Django project directory.
PROJECT_ROOT = os.path.dirname(__file__)

PROJECT_MODULE = 'kitsune'

# path bases things off of ROOT
path = lambda *a: os.path.abspath(os.path.join(ROOT, *a))

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3'
        # or 'oracle'.
        'ENGINE': 'django.db.backends.mysql',
        # Or path to database file if sqlite3.
        'NAME': 'kitsune',
        # Not used with sqlite3.
        'USER': '',
        # Not used with sqlite3.
        'PASSWORD': '',
        # Set to empty string for localhost. Not used with sqlite3.
        'HOST': '',
        # Set to empty string for default. Not used with sqlite3.
        'PORT': '',
        'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
    }
}

DATABASE_ROUTERS = ('multidb.PinningMasterSlaveRouter',)

# Put the aliases for your slave databases in this list
SLAVE_DATABASES = []

# Cache Settings
# CACHES = {
#     'default': {
#         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
#         'LOCATION': ['localhost:11211'],
#         'PREFIX': 'sumo:',
#     },
# }

# Setting this to the Waffle version.
WAFFLE_CACHE_PREFIX = 'w0.7.7a:'

# Addresses email comes from
DEFAULT_FROM_EMAIL = 'notifications@support.mozilla.org'
DEFAULT_REPLY_TO_EMAIL = 'no-reply@mozilla.org'
SERVER_EMAIL = 'server-error@support.mozilla.org'
EMAIL_SUBJECT_PREFIX = '[support] '

PLATFORM_NAME = platform.node()

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'US/Pacific'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-US'

# Supported languages
# Note: We periodically add locales to this list and it is easier to
# review with changes with one locale per line.
SUMO_LANGUAGES = (
    'af',
    'ar',
    'az',
    'bg',
    'bm',
    'bn-BD',
    'bn-IN',
    'bs',
    'ca',
    'cs',
    'da',
    'de',
    'ee',
    'el',
    'en-US',
    'es',
    'et',
    'eu',
    'fa',
    'fi',
    'fr',
    'fy-NL',
    'ga-IE',
    'gl',
    'gu-IN',
    'ha',
    'he',
    'hi-IN',
    'hr',
    'hu',
    'dsb',
    'hsb',
    'id',
    'ig',
    'it',
    'ja',
    'km',
    'kn',
    'ko',
    'ln',
    'lt',
    'mg',
    'mk',
    'ml',
    'ne-NP',
    'nl',
    'no',
    'pl',
    'pt-BR',
    'pt-PT',
    'ro',
    'ru',
    'si',
    'sk',
    'sl',
    'sq',
    'sr-Cyrl',
    'sw',
    'sv',
    'ta',
    'ta-LK',
    'te',
    'th',
    'tn',
    'tr',
    'uk',
    'ur',
    'vi',
    'wo',
    'xh',
    'xx',  # This is a test locale
    'yo',
    'zh-CN',
    'zh-TW',
    'zu',
)

# These languages won't show a warning about FxOS when contributors try
# to add content.
FXOS_LANGUAGES = [
    'af',
    'bm',
    'bn-BD',
    'bn-IN',
    'cs',
    'de',
    'ee',
    'el',
    'en-US',
    'es',
    'fr',
    'ha',
    'hi-IN',
    'hr',
    'hu',
    'ig',
    'it',
    'ln',
    'mg',
    'nl',
    'pl',
    'pt-BR',
    'pt-PT',
    'ro',
    'ru',
    'sr',
    'ta',
    'sr-Cyrl',
    'sw',
    'tr',
    'wo',
    'xh',
    'yo',
    'zu',
]

# These languages will get a wiki page instead of the product and topic pages.
SIMPLE_WIKI_LANGUAGES = [
    'az',
    'et',
    'ga-IE',
    'gl',
    'dsb',
    'hsb',
    'kn',
    'ml',