<commit_before>"""
Django settings for sqlviz project.

For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
#
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import json
import dj_database_url
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
from urllib import quote_plus as urlquote

BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/

# Default password data
pwd_data = {
    'SCRATCH': {
        'DB_TYPE': 'mysql',
        'DB': 'scratch',
        'HOST': 'localhost',
        'PWD': '<PASSWORD>',
        'USER': 'django',
        'PORT': 3306,
    },
    'SECRET_KEY': '<KEY>',
    'EMAIL': {
        'EMAIL_HOST_PASSWORD': 'test',
        'EMAIL_PORT': 587,
        'EMAIL_USE_TLS': True,
        'EMAIL_HOST_USER': '<EMAIL>',
        'EMAIL_HOST': 'smtp.gmail.com',
    },
    'DJANGO': {
        'DB': 'django',
        'DB_TYPE': 'mysql',
        'HOST': 'localhost',
        'PORT': 3306,
        'PWD': '<PASSWORD>',
        'USER': 'django',
    },
    'SCRATCH': {
        'DB_TYPE': 'mysql',
        'DB': 'scratch',
        'HOST': 'localhost',
        'PWD': '<PASSWORD>',
        'USER': 'django',
        'PORT': 3306,
    },
    'SOCIAL_AUTH_GOOGLE_OAUTH2_KEY': '',
    'SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET': ''
}

# Import PWDs from separate JSON file outside of VC
pwd_file = BASE_DIR + '/sqlviz/passwords.json'
try:
    with open(pwd_file) as json_file:
        pwd_data.update(json.load(json_file))
except IOError:
    pass


# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = pwd_data['SECRET_KEY']
# 'j_-af1@u(h7j%nkkdweuq6n$i=dyi2b+o7n8$u4szdb9^-6-j2'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['localhost']

SITE_ID = 1
# Application definition

INSTALLED_APPS = (
    'django_admin_bootstrapped',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'social.apps.django_app.default',
    'django.contrib.sites',
    'django_comments',
    'django_ace',
    'website',
    'taggit',
    'accounts',
    'django_crontab',
    'cron',
    'favit',
    'favs',
    'csv_upload',
    'scratch',
    'ml',
    'crispy_forms',
    'haystack'
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'sqlviz.urls'

WSGI_APPLICATION = 'sqlviz.wsgi.application'
# Templates
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://127.0.0.1:9200/',
        'INDEX_NAME': 'sqlviz_elasticsearch',
    },
}

if 'CI' in os.environ:
    print "USING DUMMY SEARCH"
    HAYSTACK_CONNECTIONS = {
        'default': {
            'engine': 'haystack.backends.simple_backend.SimpleEngine'
        },
    }


HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
HAYSTACK_SEARCH_RESULTS_PER_PAGE = 100
<commit_msg>one last update<commit_after>"""
Django settings for sqlviz project.

For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
#
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import json
import dj_database_url
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
from urllib import quote_plus as urlquote

BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/

# Default password data
pwd_data = {
    'SCRATCH': {
        'DB_TYPE': 'mysql',
        'DB': 'scratch',
        'HOST': 'localhost',
        'PWD': '<PASSWORD>',
        'USER': 'django',
        'PORT': 3306,
    },
    'SECRET_KEY': '<KEY>',
    'EMAIL': {
        'EMAIL_HOST_PASSWORD': '<PASSWORD>',
        'EMAIL_PORT': 587,
        'EMAIL_USE_TLS': True,
        'EMAIL_HOST_USER': '<EMAIL>',
        'EMAIL_HOST': 'smtp.gmail.com',
    },
    'DJANGO': {
        'DB': 'django',
        'DB_TYPE': 'mysql',
        'HOST': 'localhost',
        'PORT': 3306,
        'PWD': '<PASSWORD>',
        'USER': 'django',
    },
    'SCRATCH': {
        'DB_TYPE': 'mysql',
        'DB': 'scratch',
        'HOST': 'localhost',
        'PWD': '<PASSWORD>',
        'USER': 'django',
        'PORT': 3306,
    },
    'SOCIAL_AUTH_GOOGLE_OAUTH2_KEY': '',
    'SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET': ''
}

# Import PWDs from separate JSON file outside of VC
pwd_file = BASE_DIR + '/sqlviz/passwords.json'
try:
    with open(pwd_file) as json_file:
        pwd_data.update(json.load(json_file))
except IOError:
    pass


# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = pwd_data['SECRET_KEY']
# 'j_-af1@u(h7j%nkkdweuq6n$i=dyi2b+o7n8$u4szdb9^-6-j2'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = ['localhost']

SITE_ID = 1
# Application definition

INSTALLED_APPS = (
    'django_admin_bootstrapped',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'social.apps.django_app.default',
    'django.contrib.sites',
    'django_comments',
    'django_ace',
    'website',
    'taggit',
    'accounts',
    'django_crontab',
    'cron',
    'favit',
    'favs',
    'csv_upload',
    'scratch',
    'ml',
    'crispy_forms',
    'haystack'
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'sqlviz.urls'

WSGI_APPLICATION = 'sqlviz.wsgi.application'
# Templates
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
        'URL': 'http://1172.16.17.32:9200/',
        'INDEX_NAME': 'sqlviz_elasticsearch',
    },
}

if 'CI' in os.environ:
    # USING DUMMY SEARCH
    HAYSTACK_CONNECTIONS = {
        'default': {
            'engine': 'haystack.backends.simple_backend.SimpleEngine'
        },
    }


HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
HAYSTACK_SEARCH_RESULTS_PER_PAGE = 100

{'fraction_non_alphanumeric': 0.1383997928534438, 'fraction_numerical': 0.011134127395132056, 'mean_word_length': 3.3570219966159054, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1412592', 'n_tokens_mistral': 2804, 'n_tokens_neox': 2725, 'n_words': 497}