<commit_before># Django settings for humbug project.
#
# DO NOT PUT ANY SECRETS IN THIS FILE.
# Those belong in local_settings.py.
import os
import platform
import time
import sys
import ConfigParser

from zerver.openid import openid_failure_handler

config_file = ConfigParser.RawConfigParser()
config_file.read("/etc/zulip/zulip.conf")

# Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# and as such should not for example assume they are the main Zulip site.
DEPLOYED = config_file.has_option('machine', 'deploy_type')
STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging'
TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'test'

LOCAL_SERVER = DEPLOYED and config_file.get('machine', 'deploy_type') == 'local'

# Import variables like secrets from the local_settings file
# Import local_settings after determining the deployment/machine type
from local_settings import *

SERVER_GENERATION = int(time.time())

# Uncomment end of next line to test JS/CSS minification.
DEBUG = not DEPLOYED # and platform.node() != 'your-machine'
TEMPLATE_DEBUG = DEBUG
TEST_SUITE = False

if DEBUG:
    INTERNAL_IPS = ('127.0.0.1',)
if TESTING_DEPLOYED or LOCAL_SERVER:
    # XXX we should probably tighten this for LOCAL_SERVER
    # Allow any hosts for our test instances, to reduce 500 spam
    ALLOWED_HOSTS = ['*']
elif DEPLOYED:
    # The IP addresses are for app.zulip.{com,net} and staging.zulip.{com,net}
    ALLOWED_HOSTS = ['localhost', '.humbughq.com', '172.16.31.10', '192.168.3.11',
                     '172.16.17.32', '172.16.17.32', '172.16.58.3',
                     '192.168.127.12', '172.16.17.32', '.zulip.com', '.zulip.net']
else:
    ALLOWED_HOSTS = ['localhost']

ADMINS = (
    ('Zulip Error Reports', '<EMAIL>'),
)

MANAGERS = ADMINS

DATABASES = {"default": {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'zulip',
    'USER': 'zulip',
    'PASSWORD': '', # Authentication done via certificates
    'HOST': 'postgres.zulip.net',
    'SCHEMA': 'zulip',
    'CONN_MAX_AGE': 600,
    'OPTIONS': {
        'sslmode': 'verify-full',
        'autocommit': True,
        },
    },
}

if not DEPLOYED or LOCAL_SERVER:
    DATABASES["default"].update({
            'PASSWORD': LOCAL_DATABASE_PASSWORD,
            'HOST': 'localhost',
            'OPTIONS': {
                'autocommit': True,
            }
            })
    INTERNAL_ZULIP_USERS = []

# 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.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/New_York'

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

# The ID, as an integer, of the current site in the django_site database table.
# This is used so that application data can hook into specific site(s) and a
# single database can manage content for multiple sites.
#
# We set this site's domain to 'zulip.com' in populate_db.
SITE_ID = 1<commit_msg>Don't require LOCAL_DATABASE_PASSWORD on local server.<commit_after># Django settings for humbug project.
#
# DO NOT PUT ANY SECRETS IN THIS FILE.
# Those belong in local_settings.py.
import os
import platform
import time
import sys
import ConfigParser

from zerver.openid import openid_failure_handler

config_file = ConfigParser.RawConfigParser()
config_file.read("/etc/zulip/zulip.conf")

# Whether we're running in a production environment. Note that DEPLOYED does
# **not** mean hosted by us; customer sites are DEPLOYED and LOCAL_SERVER
# and as such should not for example assume they are the main Zulip site.
DEPLOYED = config_file.has_option('machine', 'deploy_type')
STAGING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'staging'
TESTING_DEPLOYED = DEPLOYED and config_file.get('machine', 'deploy_type') == 'test'

LOCAL_SERVER = DEPLOYED and config_file.get('machine', 'deploy_type') == 'local'

# Import variables like secrets from the local_settings file
# Import local_settings after determining the deployment/machine type
from local_settings import *

SERVER_GENERATION = int(time.time())

# Uncomment end of next line to test JS/CSS minification.
DEBUG = not DEPLOYED # and platform.node() != 'your-machine'
TEMPLATE_DEBUG = DEBUG
TEST_SUITE = False

if DEBUG:
    INTERNAL_IPS = ('127.0.0.1',)
if TESTING_DEPLOYED or LOCAL_SERVER:
    # XXX we should probably tighten this for LOCAL_SERVER
    # Allow any hosts for our test instances, to reduce 500 spam
    ALLOWED_HOSTS = ['*']
elif DEPLOYED:
    # The IP addresses are for app.zulip.{com,net} and staging.zulip.{com,net}
    ALLOWED_HOSTS = ['localhost', '.humbughq.com', '172.16.31.10', '192.168.3.11',
                     '172.16.17.32', '172.16.17.32', '172.16.58.3',
                     '192.168.127.12', '172.16.17.32', '.zulip.com', '.zulip.net']
else:
    ALLOWED_HOSTS = ['localhost']

ADMINS = (
    ('Zulip Error Reports', '<EMAIL>'),
)

MANAGERS = ADMINS

DATABASES = {"default": {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'zulip',
    'USER': 'zulip',
    'PASSWORD': '', # Authentication done via certificates
    'HOST': 'postgres.zulip.net',
    'SCHEMA': 'zulip',
    'CONN_MAX_AGE': 600,
    'OPTIONS': {
        'sslmode': 'verify-full',
        'autocommit': True,
        },
    },
}

if LOCAL_SERVER:
    DATABASES["default"].update({
            'HOST': 'localhost',
            'OPTIONS': {
                'autocommit': True,
            }
            })
elif not DEPLOYED:
    DATABASES["default"].update({
            'PASSWORD': LOCAL_DATABASE_PASSWORD,
            'HOST': 'localhost',
            'OPTIONS': {
                'autocommit': True,
            }
            })
    INTERNAL_ZULIP_USERS = []

# 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.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/New_York'

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

# The ID, as an integer, of the current site in the django_site database table.
# This is used so that application data can hook into specific site(s) and a
# single database can manage content for multiple sites.
#
# We set this site's domain to 'zulip.com' in populate_db.
SITE_ID = 1
{'fraction_non_alphanumeric': 0.11588867618907378, 'fraction_numerical': 0.02356059490502135, 'mean_word_length': 3.506967485069675, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 16, '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': '1265464', 'n_tokens_mistral': 2385, 'n_tokens_neox': 2223, 'n_words': 666}