<commit_before># Django local settings for finding aids project.

# all settings in debug section should be false in production environment
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DEV_ENV = True

# IP addresses that should be allowed to see DEBUG info
INTERNAL_IPS = ('127.0.0.1', '127.0.1.1')

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

MANAGERS = ADMINS

SERVER_EMAIL = ''       # email where default messages come from; django default is root@localhost
EMAIL_SUBJECT_PREFIX = '[EmoryFindingAids] ' # prefix for email subjects
FEEDBACK_EMAIL = []     # list of email addresses to receive site feedback

# email addresses & archives repositories for the request materials form
REQUEST_MATERIALS_CONTACTS = (
    # ('email address', 'name'),
)

# RDB used for user account management.
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',   # The database backend you plan to use
        'NAME': 'database you are using',       # Database name
        'HOST': '',                             # Host you want to connect to. An empty string means localhost.
        'USER': 'user',                         # The username to use when connecting to the database.
        'PASSWORD': 'password',                 # The password to use when connecting to the database.
    }
}

#Specify Session Engine
CACHE_BACKEND = 'file:///tmp/findingaids_cache?timeout=1800'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

#Exist DB Settings
EXISTDB_SERVER_USER     = 'user'
EXISTDB_SERVER_PASSWORD = 'password'
EXISTDB_SERVER_URL      = "http://existdb.example.com/exist"
# collection should begin with / -  e.g., /edc
EXISTDB_ROOT_COLLECTION = ""
# preview collection - should be outside main findingaids collection
EXISTDB_PREVIEW_COLLECTION = ""
EXISTDB_TEST_COLLECTION = ""
# NOTE: EXISTDB_INDEX_CONFIGFILE is configured in settings.py

# connection timeout for requests to eXist in seconds
EXISTDB_TIMEOUT = 30

# a bug in python xmlrpclib loses the timezone; override it here
# most likely, you want either tz.tzlocal() or tz.tzutc()
from dateutil import tz
EXISTDB_SERVER_TIMEZONE = tz.tzlocal()


# EULCORE LDAP SETTINGS
# LDAP login settings. These are configured for emory, but you'll need
# to get a base user DN and password elsewhere.
AUTH_LDAP_SERVER = '' # i.e. 'ldaps://vlad.service.emory.edu'
AUTH_LDAP_BASE_USER = '' # i.e. 'uid=USERNAME,ou=services,o=emory.edu'
AUTH_LDAP_BASE_PASS = '' # password for USERNAME above
AUTH_LDAP_SEARCH_SUFFIX = '' # i.e. 'o=emory.edu'
AUTH_LDAP_SEARCH_FILTER = '' # i.e. '(uid=%s)'
AUTH_LDAP_CHECK_SERVER_CERT = False # ALWAYS SET True in production.
AUTH_LDAP_CA_CERT_PATH = '' # absolute path of cert

# PID manager settings
PIDMAN_HOST = '' # base url for PID manager - use SSL if possible, e.g. https://pid.emory.edu/
PIDMAN_USER = '' # Username for authentication to the pidman app.
PIDMAN_PASSWORD = '' # Pasword for username above.
PIDMAN_DOMAIN = ''      # PID manager domain, in this format: https://pid.emory.edu/domains/1/

# local, full-path location for finding aids to be loaded to eXist via admin interface
FINDINGAID_EAD_SOURCE= '/mnt/entity/staff/Special Collections/EADXML/FinishedMARBL'

# full path to XSL-FO processor (currently expects Apache Fop)
XSLFO_PROCESSOR = '/usr/bin/fop'

# settings for proxy host and site base url; used to configure cache to reload
# a PDF when publishing a new or updated EAD
PROXY_HOST = 'localhost:3128'
SITE_BASE_URL = 'http://findingaids.library.emory.edu'
PROXY_ICP_PORT = 3130       # ICP port for checking status of objects in cache

# settings for celery & rabbit-mq for asynchronous task handling
BROKER_HOST = '127.0.0.1'
BROKER_PORT = 5672
BROKER_VHOST = '/'
BROKER_USER = 'guest'
BROKER_PASSWORD = '<PASSWORD>'

# URLS for RSS feeds to populate site content pages
CONTENT_RSS_FEEDS = {
    'banner': '',
    'news': '',
    'content': '',
}

# reCAPTCHA keys for your server or domain from https://www.google.com/recaptcha/
RECAPTCHA_PUBLIC_KEY = ''
RECAPTCHA_PRIVATE_KEY = ''
RECAPTCHA_OPTIONS = {}   # optional; e.g., {'theme': 'white'}

# 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 = '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'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = ''

# configure an HTTP PROXY to enable lxml to cache XML Schemas (e.g., EAD XSD)
import os
os.putenv('HTTP_PROXY', 'http://localhost:3128/')  # local squid proxy on default port

# Sample logging configuration for Django 1.3.
# Be sure to preserve the configuration is to send an email to the
# site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for more
# details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'formatters': {
        'basic': {
            'format': '[%(asctime)s] %(levelname)s:%(name)s::%(message)s',
            'datefmt': '%d/%b/%Y %H:%M:%S',
         },
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            'include_html': True,
        }
        ,
        'console':{
            'level':'INFO',
            'class':'logging.StreamHandler',
            'formatter': 'basic'
        },
        'file':{
            'level': 'INFO',
            'class': 'logging.handlers.RotatingFileHandler',
            'filename': '/tmp/django-findingaids.log',
            'maxBytes': 1024,
            'backupCount': 3,
            'formatter': 'basic',
        },

    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
       'django': {
            'handlers': ['console'],
            'level': 'INFO',
            'propagate': True,
        },
    }
}<commit_msg>set default django logging (in example config) to warn/file instead of info/console<commit_after># Django local settings for finding aids project.

# all settings in debug section should be false in production environment
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DEV_ENV = True

# IP addresses that should be allowed to see DEBUG info
INTERNAL_IPS = ('127.0.0.1', '127.0.1.1')

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

MANAGERS = ADMINS

SERVER_EMAIL = ''       # email where default messages come from; django default is root@localhost
EMAIL_SUBJECT_PREFIX = '[EmoryFindingAids] ' # prefix for email subjects
FEEDBACK_EMAIL = []     # list of email addresses to receive site feedback

# email addresses & archives repositories for the request materials form
REQUEST_MATERIALS_CONTACTS = (
    # ('email address', 'name'),
)

# RDB used for user account management.
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',   # The database backend you plan to use
        'NAME': 'database you are using',       # Database name
        'HOST': '',                             # Host you want to connect to. An empty string means localhost.
        'USER': 'user',                         # The username to use when connecting to the database.
        'PASSWORD': 'password',                 # The password to use when connecting to the database.
    }
}

#Specify Session Engine
CACHE_BACKEND = 'file:///tmp/findingaids_cache?timeout=1800'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

#Exist DB Settings
EXISTDB_SERVER_USER     = 'user'
EXISTDB_SERVER_PASSWORD = 'password'
EXISTDB_SERVER_URL      = "http://existdb.example.com/exist"
# collection should begin with / -  e.g., /edc
EXISTDB_ROOT_COLLECTION = ""
# preview collection - should be outside main findingaids collection
EXISTDB_PREVIEW_COLLECTION = ""
EXISTDB_TEST_COLLECTION = ""
# NOTE: EXISTDB_INDEX_CONFIGFILE is configured in settings.py

# connection timeout for requests to eXist in seconds
EXISTDB_TIMEOUT = 30

# a bug in python xmlrpclib loses the timezone; override it here
# most likely, you want either tz.tzlocal() or tz.tzutc()
from dateutil import tz
EXISTDB_SERVER_TIMEZONE = tz.tzlocal()


# EULCORE LDAP SETTINGS
# LDAP login settings. These are configured for emory, but you'll need
# to get a base user DN and password elsewhere.
AUTH_LDAP_SERVER = '' # i.e. 'ldaps://vlad.service.emory.edu'
AUTH_LDAP_BASE_USER = '' # i.e. 'uid=USERNAME,ou=services,o=emory.edu'
AUTH_LDAP_BASE_PASS = '' # password for USERNAME above
AUTH_LDAP_SEARCH_SUFFIX = '' # i.e. 'o=emory.edu'
AUTH_LDAP_SEARCH_FILTER = '' # i.e. '(uid=%s)'
AUTH_LDAP_CHECK_SERVER_CERT = False # ALWAYS SET True in production.
AUTH_LDAP_CA_CERT_PATH = '' # absolute path of cert

# PID manager settings
PIDMAN_HOST = '' # base url for PID manager - use SSL if possible, e.g. https://pid.emory.edu/
PIDMAN_USER = '' # Username for authentication to the pidman app.
PIDMAN_PASSWORD = '' # <PASSWORD> for username above.
PIDMAN_DOMAIN = ''      # PID manager domain, in this format: https://pid.emory.edu/domains/1/

# local, full-path location for finding aids to be loaded to eXist via admin interface
FINDINGAID_EAD_SOURCE= '/mnt/entity/staff/Special Collections/EADXML/FinishedMARBL'

# full path to XSL-FO processor (currently expects Apache Fop)
XSLFO_PROCESSOR = '/usr/bin/fop'

# settings for proxy host and site base url; used to configure cache to reload
# a PDF when publishing a new or updated EAD
PROXY_HOST = 'localhost:3128'
SITE_BASE_URL = 'http://findingaids.library.emory.edu'
PROXY_ICP_PORT = 3130       # ICP port for checking status of objects in cache

# settings for celery & rabbit-mq for asynchronous task handling
BROKER_HOST = '127.0.0.1'
BROKER_PORT = 5672
BROKER_VHOST = '/'
BROKER_USER = 'guest'
BROKER_PASSWORD = '<PASSWORD>'

# URLS for RSS feeds to populate site content pages
CONTENT_RSS_FEEDS = {
    'banner': '',
    'news': '',
    'content': '',
}

# reCAPTCHA keys for your server or domain from https://www.google.com/recaptcha/
RECAPTCHA_PUBLIC_KEY = ''
RECAPTCHA_PRIVATE_KEY = ''
RECAPTCHA_OPTIONS = {}   # optional; e.g., {'theme': 'white'}

# 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 = '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'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = ''

# configure an HTTP PROXY to enable lxml to cache XML Schemas (e.g., EAD XSD)
import os
os.putenv('HTTP_PROXY', 'http://localhost:3128/')  # local squid proxy on default port

# Sample logging configuration for Django 1.3.
# Be sure to preserve the configuration is to send an email to the
# site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for more
# details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'formatters': {
        'basic': {
            'format': '[%(asctime)s] %(levelname)s:%(name)s::%(message)s',
            'datefmt': '%d/%b/%Y %H:%M:%S',
         },
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler',
            'include_html': True,
        }
        ,
        'console':{
            'level':'INFO',
            'class':'logging.StreamHandler',
            'formatter': 'basic'
        },
        'file':{
            'level': 'INFO',
            'class': 'logging.handlers.RotatingFileHandler',
            'filename': '/tmp/django-findingaids.log',
            'maxBytes': 1024,
            'backupCount': 3,
            'formatter': 'basic',
        },

    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
       'django': {
            'handlers': ['file'],
            'level': 'WARN',
            'propagate': True,
        },
    }
}
{'fraction_non_alphanumeric': 0.11424418604651163, 'fraction_numerical': 0.008284883720930232, 'mean_word_length': 3.197986577181208, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4022692', 'n_tokens_mistral': 4490, 'n_tokens_neox': 4292, 'n_words': 1369}