<commit_before>"""Django project settings for ahmia."""
import os
import sys
# Set the PROJECT_HOME variable.
# This will be used to prepend to all file/directory paths.
PROJECT_HOME = os.path.join(os.getcwd(), 'ahmia')

# Define DEBUG state dynamically:
# If running server using manage.py => DEBUG = True else DEBUG = False
if len(sys.argv) > 1 and sys.argv[1] == 'runserver':
    DEBUG = True
    # In demo environment use this YaCy address
    YACY = "http://localhost:8888/"
else:
    # This is the YaCy address in the ahmia.fi
    YACY = "http://10.8.0.10:8090/"
    DEBUG = False

TEMPLATE_DEBUG = DEBUG

ALLOWED_HOSTS = [
    '.ahmia.fi', # Allow domain and subdomains
    '.ahmia.fi.', # Also allow FQDN and subdomains
    '.msydqstlz2kzerdg.onion',
    '.msydqstlz2kzerdg.onion.',
]

ADMINS = (
    # ('Your Name', '<EMAIL>'),
)

MANAGERS = ADMINS

if 'test' in sys.argv:
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Database engine
        'NAME': os.getcwd() + '/ahmia_db_test', # Database name
        }
    }
else:
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Database engine
        'NAME': os.getcwd() + '/ahmia_db', # Database name
        }
    }

# Email settings
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '<EMAIL>'
EMAIL_HOST_PASSWORD = '<PASSWORD>'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
RECIPIENT_LIST = [DEFAULT_FROM_EMAIL]

# 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.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

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

SITE_ID = 1
<commit_msg>Back to PostgreSQL.<commit_after>"""Django project settings for ahmia."""
import os
import sys
# Set the PROJECT_HOME variable.
# This will be used to prepend to all file/directory paths.
PROJECT_HOME = os.path.join(os.getcwd(), 'ahmia')

# Define DEBUG state dynamically:
# If running server using manage.py => DEBUG = True else DEBUG = False
if 'runserver' in sys.argv:
    DEBUG = True
    # In demo environment use this YaCy address
    YACY = "http://localhost:8888/"
else:
    # This is the YaCy address in the ahmia.fi
    YACY = "http://10.8.0.10:8090/"
    DEBUG = False

TEMPLATE_DEBUG = DEBUG

ALLOWED_HOSTS = [
    '.ahmia.fi', # Allow domain and subdomains
    '.ahmia.fi.', # Also allow FQDN and subdomains
    '.msydqstlz2kzerdg.onion',
    '.msydqstlz2kzerdg.onion.',
]

ADMINS = (
    # ('<NAME>', '<EMAIL>'),
)

MANAGERS = ADMINS

if 'test' in sys.argv:
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Database engine
        'NAME': os.getcwd() + '/ahmia_db_test', # Database name
        }
    }
elif 'runserver' in sys.argv:
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Database engine
        'NAME': os.getcwd() + '/ahmia_db', # Database name
        }
    }
else: # Production environment
    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Database engine
        'NAME': 'ahmia_db',              # Database name
        'USER': 'ahmia_login',           # Not used with sqlite3.
        'PASSWORD': '<PASSWORD>',     # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost.
        'PORT': '6432', # pbbouncer port
        }
    }

# Email settings
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '<EMAIL>'
EMAIL_HOST_PASSWORD = '<PASSWORD>'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
RECIPIENT_LIST = [DEFAULT_FROM_EMAIL]

# 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.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

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

SITE_ID = 1

{'fraction_non_alphanumeric': 0.11792759592456102, 'fraction_numerical': 0.01235638413180143, 'mean_word_length': 3.1755656108597283, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1940032', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1568, 'n_words': 464}