<commit_before>#:coding=utf-8:

# ローカル開発用の settings.py
# この設定はデフォルトで sqlite を使います。
# DB バックエンドは DB_ENGINE の環境変数で設定できます。
# 例: DB_ENGINE=postgresql_psycopg2 python manage.py runserver

# 設定できる環境変数
# DEBUG
# DB_ENGINE
# DB_NAME
# DB_HOST
# DB_PORT
# DB_USER
# DB_PASSWORD

from .dev import *  # NOQA


def env_var(var, var_type=None, *args, **kwargs):
    u"""
    環境変数の値を返す

    例: env_var("HOGE_SETTING", int, default=123)
    """
    try:
        val = os.environ[var]
    except KeyError:
        if not args and 'default' not in kwargs:
            raise ImproperlyConfigured('The environment variable "%s" is required.' % var)
        elif args:
            val = args[0]
        else:
            val = kwargs['default']

    if var_type:
        try:
            val = var_type(val)
        except ValueError, e:
            raise ImproperlyConfigured('Invalid setting for "%s": "%s"' % (var, e))

    return val

DEBUG = env_var('DEBUG', bool, default=True)

_db_engine = env_var('DB_ENGINE', default='sqlite3' if DEBUG else 'postgresql_psycopg2')
_db_name = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
                        'sotmjp2014.sqlite') if _db_engine == 'sqlite3' else 'sotmjp2014_staging'
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.%s' % _db_engine,
        'NAME': env_var('DB_NAME', default=_db_name),
        'USER': env_var('DB_USER', default=''),
        'PASSWORD': env_var('DB_PASSWORD', default=''),
        'HOST': env_var('DB_HOST', default=''),
        'PORT': env_var('DB_PORT', default=''),
    }
}
LANGUAGE_CODE = "ja-jp"

INSTALLED_APPS += ['debug_toolbar']<commit_msg>use dbname as 2015 and fix MARKITUP_FILTER setup<commit_after>#:coding=utf-8:

# ローカル開発用の settings.py
# この設定はデフォルトで sqlite を使います。
# DB バックエンドは DB_ENGINE の環境変数で設定できます。
# 例: DB_ENGINE=postgresql_psycopg2 python manage.py runserver

# 設定できる環境変数
# DEBUG
# DB_ENGINE
# DB_NAME
# DB_HOST
# DB_PORT
# DB_USER
# DB_PASSWORD

from .dev import *  # NOQA


def env_var(var, var_type=None, *args, **kwargs):
    u"""
    環境変数の値を返す

    例: env_var("HOGE_SETTING", int, default=123)
    """
    try:
        val = os.environ[var]
    except KeyError:
        if not args and 'default' not in kwargs:
            raise ImproperlyConfigured('The environment variable "%s" is required.' % var)
        elif args:
            val = args[0]
        else:
            val = kwargs['default']

    if var_type:
        try:
            val = var_type(val)
        except ValueError, e:
            raise ImproperlyConfigured('Invalid setting for "%s": "%s"' % (var, e))

    return val

DEBUG = env_var('DEBUG', bool, default=True)

_db_engine = env_var('DB_ENGINE', default='sqlite3' if DEBUG else 'postgresql_psycopg2')
_db_name = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
                        'sotmjp2015.sqlite') if _db_engine == 'sqlite3' else 'sotmjp2015_staging'
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.%s' % _db_engine,
        'NAME': env_var('DB_NAME', default=_db_name),
        'USER': env_var('DB_USER', default=''),
        'PASSWORD': env_var('DB_PASSWORD', default=''),
        'HOST': env_var('DB_HOST', default=''),
        'PORT': env_var('DB_PORT', default=''),
    }
}
LANGUAGE_CODE = "ja-jp"
MARKITUP_FILTER = ('django.contrib.markup.templatetags.markup.textile', {})

INSTALLED_APPS += ['debug_toolbar']
{'fraction_non_alphanumeric': 0.14152319813247738, 'fraction_numerical': 0.011088415523781734, 'mean_word_length': 3.09557945041816, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1518338', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1319, 'n_words': 262}