Skip to content
Snippets Groups Projects
Commit a16104c0 authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Removed settingsdir

parent 67739e7b
No related branches found
No related tags found
No related merge requests found
# Django settings for gracedb project.
try:
# Workaround for a bug
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=473584
# http://bugs.python.org/setuptools/issue36
# import MySQLdb followed by import pkg_resources complains
# /usr/lib/python2.6/dist-packages/pytz/__init__.py:32: UserWarning: Module _mysql was already imported from /usr/lib/pymodules/python2.6/_mysql.so, but /usr/lib/pymodules/python2.6 is being added to sys.path
import pkg_resources
except:
pass
import os
ROOT_PATH = os.path.abspath( os.path.join( os.path.dirname(__file__), os.pardir ) )
configs = {
'/home/bmoe/ER2': 'development_er2',
'/home/bmoe/er2box/lib/python2.6/site-packages/gracedb' : 'development_er2',
'/home/bmoe/er2box/lib/python2.6/site-packages/ER2' : 'development_er2',
'/home/bmoe/gracedb': 'development',
'/home/bmoe/gracedb/gracedb': 'development',
'/home/gracedb/gracedb': 'production',
'/home/gracedb/graceproj': 'production',
'/home/branson/gracedbdev': 'branson',
'/home/branson/gracedbdev/gracedb': 'branson',
'/home/fzhang/gracedb/gracedb': 'fan',
'/home/fzhang/gracedb/gracedb/gracedb': 'fan',
"/home/gracedb/gracestage" : "stage",
}
from default import *
config = configs.get(ROOT_PATH, "production")
settings_module = __import__('%s' % config, globals(), locals(), 'gracedb')
# Load the config settings properties into the local scope.
for setting in dir(settings_module):
if setting == setting.upper():
locals()[setting] = getattr(settings_module, setting)
CONFIG_NAME = "Branson"
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default' : {
'NAME' : 'gracedb',
'ENGINE' : 'django.db.backends.mysql',
'USER' : 'branson',
'PASSWORD' : 'thinglet',
}
}
#MEDIA_URL = "/branson-static/"
STATIC_URL = "/branson-static/"
STATIC_ROOT = "/home/branson/gracedbdev/static/"
GRACEDB_DATA_DIR = "/home/branson/fake_data"
ALERT_EMAIL_FROM = "Dev Alert <root@moe.phys.uwm.edu>"
ALERT_EMAIL_TO = [
"Branson Stephens <branson@gravity.phys.uwm.edu>",
]
ALERT_EMAIL_BCC = ["branson@gravity.phys.uwm.edu"]
ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@moe.phys.uwm.edu>"
ALERT_TEST_EMAIL_TO = [
"Branson Stephens <branson@gravity.phys.uwm.edu>",
]
# Don't sent out non-test XMPP alerts on dev box!
XMPP_ALERT_CHANNELS = [
'test_omega',
'test_mbtaonline',
'test_cwb',
'test_lowmass',
]
# Latency histograms. Where they go and max latency to bin.
LATENCY_REPORT_DEST_DIR = "/home/branson/data/latency"
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# Uptime reporting
UPTIME_REPORT_DIR = "/homebransonbmoe/data/uptime"
SITE_ID = 4
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"/home/branson/gracedbdev/templates",
)
MIDDLEWARE_CLASSES = [
'middleware.accept.AcceptMiddleware',
'middleware.cli.CliExceptionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'ligodjangoauth.LigoShibbolethMiddleware',
'ligoauth.middleware.auth.LigoAuthMiddleware',
'maintenancemode.middleware.MaintenanceModeMiddleware',
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
]
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'gracedb',
'userprofile',
'ligoauth',
'rest_framework',
'south',
# 'debug_toolbar',
)
#INTERNAL_IPS = (
# '129.89.61.55',
#)
# Settings for Logging.
import logging
LOG_ROOT = '/home/branson/logs'
LOG_FILE_SIZE = 1024*1024 # 1 MB
LOG_FILE_BAK_CT = 3
LOG_FORMAT = 'verbose'
LOG_LEVEL = 'DEBUG'
# Filter objects to separate out each level of alert.
# Otherwise the log files for each level would contain the
# output for each higher level.
class debugOnlyFilter(logging.Filter):
def filter(self,record):
if record.levelname=='DEBUG':
return 1
return 0
class infoOnlyFilter(logging.Filter):
def filter(self,record):
if record.levelname=='INFO':
return 1
return 0
class debugPlusInfo(logging.Filter):
def filter(self,record):
if record.levelname=='INFO' or record.levelname=='DEBUG':
return 1
return 0
class warningOnlyFilter(logging.Filter):
def filter(self,record):
if record.levelname=='WARNING':
return 1
return 0
class errorOnlyFilter(logging.Filter):
def filter(self,record):
if record.levelname=='ERROR':
return 1
return 0
# Note that mode for log files is 'a' (append) by default
# The 'level' specifier on the handle is optional, and we
# don't need it since we're using custom filters.
LOGGING = {
'version': 1,
'disable_existing_loggers' : True,
'formatters': {
'simple': {
'format': '%(levelname)s %(message)s',
},
'verbose': {
'format': '%(asctime)s: %(name)s: %(message)s',
'datefmt': '%Y-%m-%d %H:%M:%S',
},
},
# 'filters': {
# 'debugOnly': {
# '()': 'settings.logSettings.debugOnlyFilter',
# },
# 'infoOnly': {
# '()': 'settings.logSettings.infoOnlyFilter',
# },
# 'debugPlusInfo': {
# '()': 'settings.logSettings.debugPlusInfo',
# },
# 'warningOnly': {
# '()': 'settings.logSettings.warningOnlyFilter',
# },
# 'errorOnly': {
# '()': 'settings.logSettings.errorOnlyFilter',
# },
# },
'handlers': {
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'debug_file': {
'class': 'logging.handlers.RotatingFileHandler',
'formatter': LOG_FORMAT,
# Commented out so that the debug file will have *everything*
# That should make it somewhat easier to read through.
# 'filters': ['debugPlusInfo'],
'filename': '%s/gracedb_debug.log' % LOG_ROOT,
'maxBytes': LOG_FILE_SIZE,
'backupCount': LOG_FILE_BAK_CT,
},
# 'info_file': {
# 'class': 'logging.handlers.RotatingFileHandler',
# 'formatter': LOG_FORMAT,
# 'filters': ['infoOnly'],
# 'filename': '%s/gracedb_info.log' % LOG_ROOT,
# 'maxBytes': LOG_FILE_SIZE,
# 'backupCount': LOG_FILE_BAK_CT,
# },
# 'warning_file': {
# 'class': 'logging.handlers.RotatingFileHandler',
# 'formatter': LOG_FORMAT,
# 'filters': ['warningOnly'],
# 'filename': '%s/gracedb_warning.log' % LOG_ROOT,
# 'maxBytes': LOG_FILE_SIZE,
# 'backupCount': LOG_FILE_BAK_CT,
# },
# 'error_file': {
# 'class': 'logging.handlers.RotatingFileHandler',
# 'formatter': LOG_FORMAT,
# 'filters': ['errorOnly'],
# 'filename': '%s/gracedb_error.log' % LOG_ROOT,
# 'maxBytes': LOG_FILE_SIZE,
# 'backupCount': LOG_FILE_BAK_CT,
# },
'performance_file': {
'class': 'logging.FileHandler',
'formatter': 'simple',
'filename': '%s/gracedb_performance.log' % LOG_ROOT,
},
},
'loggers': {
'django': {
'handlers': ['null'],
'propagate': True,
'level': 'INFO',
},
'gracedb': {
# 'handlers': ['debug_file', 'info_file', 'warning_file', 'error_file'],
'handlers': ['debug_file'],
'propagate': True,
'level': LOG_LEVEL,
},
'middleware': {
'handlers': ['performance_file'],
'propagate': True,
'level': 'INFO',
},
# 'userprofile': {
# 'handlers': ['debug_file', 'info_file', 'warning_file', 'error_file'],
# 'propagate': True,
# 'level': LOG_LEVEL,
# },
},
}
# Suitable for production
ALLOWED_HOSTS = ['*']
DEBUG = False
TEMPLATE_DEBUG = DEBUG
MAINTENANCE_MODE= False
EMAIL_HOST = 'gravity.phys.uwm.edu'
ADMINS = (
('Branson Stephens', 'branson@gravity.phys.uwm.edu'),
)
MANAGERS = ADMINS
ALERT_EMAIL_FROM = "GraCEDb <gracedb@archie.phys.uwm.edu>"
ALERT_EMAIL_TO = [
# "gracedb@listserv.ligo.org",
]
ALERT_EMAIL_BCC = [
]
ALERT_TEST_EMAIL_FROM = "GraCEDb TEST <gracedb@archie.phys.uwm.edu>"
ALERT_TEST_EMAIL_TO = [
]
XMPP_ALERT_CHANNELS = [
'burst_omega',
'test_omega',
'cbc_mbtaonline',
'test_mbtaonline',
'burst_cwb',
'test_cwb',
'cbc_lowmass',
'test_lowmass',
'cbc_highmass',
'test_highmass',
'test_grb',
'external_grb',
]
BLESSED_TAGS = [
'analyst_comments',
'psd',
'data_quality',
'sky_loc',
'background',
'ext_coinc',
'strain',
'tfplots',
'sig_info',
'audio',
]
DATABASES = {
'default' : {
'NAME' : 'gracedb',
'ENGINE' : 'django.db.backends.mysql',
'USER' : 'gracedb',
'PASSWORD' : 'redrum4x',
}
}
# SkyAlert
SKYALERT_IVORN_PATTERN = "ivo://gwnet#%s"
SKYALERT_ROLE = "test"
SKYALERT_DESCRIPTION = "Report of a candidate gravitational wave event"
SKYALERT_SUBMITTERS = ['Patrick Brady', 'Brian Moe']
GRACEDB_DATA_DIR = "/mnt/gracedb-web/data"
#GRACEDB_DATA_DIR = "/mnt/gracedb-web-temp/data"
# Latency histograms. Where they go and max latency to bin.
LATENCY_REPORT_DEST_DIR = "/home/gracedb/data/latency"
LATENCY_MAXIMUM_CHARTED = 1800
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# Uptime reporting
UPTIME_REPORT_DIR = "/home/gracedb/data/uptime"
# Find another way to do this.
#
# CBC IFAR Reports
from utils import posixToGpsTime
from datetime import datetime, timedelta
import time
now = datetime.now()
yesterday = now - timedelta(days=1)
lastweek = now - timedelta(days=7)
now = posixToGpsTime(time.mktime(now.timetuple()))
yesterday = posixToGpsTime(time.mktime(yesterday.timetuple()))
lastweek = posixToGpsTime(time.mktime(lastweek.timetuple()))
REPORT_IFAR_IMAGE_DIR = LATENCY_REPORT_DEST_DIR
REPORTS_IFAR = [
#(query, axis_label, title, fname),
("LowMass %d..%d" % (yesterday, now),
"GraceDB CBC LowMass ER1 events",
"ER1 FARs from gstlal_ll_inspiral - last day",
"ifar_day.png"
),
("LowMass %d..%d" % (lastweek, now),
"GraceDB CBC LowMass ER1 events",
"ER1 FARs from gstlal_ll_inspiral - last week",
"ifar_week.png"
),
]
# RSS Feed Defaults
FEED_MAX_RESULTS = 50
# 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/Chicago'
GRACE_DATETIME_FORMAT = 'Y-m-d H:i:s T'
# 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 = False
# 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 = '/gracedb-static/'
# 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 = '$$&hl%^_4&s0k7sbdr8ll_^gkz-j8oab0tz$t^^b-%$!83d(av'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
#'django.template.loaders.filesystem.load_template_source',
# replaced by...
'django.template.loaders.filesystem.Loader',
# Upgrade to 1.4
#'django.template.loaders.app_directories.load_template_source',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.load_template_source',
)
TEMPLATE_CONTEXT_PROCESSORS = (
#"django.core.context_processors.auth",
# replaced by...
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.request",
"gracedb.middleware.auth.LigoAuthContext",
'middleware.debug.LigoDebugContext',
)
AUTHENTICATION_BACKENDS = (
# 'gracedb.middleware.auth.LigoAuthBackend',
'ligoauth.middleware.auth.LigoX509Backend',
'ligoauth.middleware.auth.LigoShibBackend',
# 'ligoauth.middleware.auth.RemoteUserBackend',
# 'ligodjangoauth.LigoShibbolethAuthBackend',
# 'django.contrib.auth.backends.ModelBackend',
)
SHIB_AUTHENTICATION_SESSION_INITIATOR = 'https://moe.phys.uwm.edu/Shibboleth.sso/Login'
# If these are left at default, when the Shibboleth middleware
# creates a new auth_user, they will get admin privs.
ADMIN_GROUP_HEADER = None
ADMIN_GROUP = None
MIDDLEWARE_CLASSES = [
'middleware.performance.PerformanceMiddleware',
'middleware.accept.AcceptMiddleware',
'middleware.cli.CliExceptionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'ligodjangoauth.LigoShibbolethMiddleware',
'ligoauth.middleware.auth.LigoAuthMiddleware',
# 'django.contrib.auth.middleware.RemoteUserMiddleware',
'maintenancemode.middleware.MaintenanceModeMiddleware',
]
ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"/home/gracedb/graceproj/templates",
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'gracedb',
'userprofile',
'ligoauth',
'rest_framework',
'south',
)
REST_FRAMEWORK = {
'PAGINATE_BY': 10
}
STATIC_URL = "/gracedb-static/"
STATIC_ROOT = "/home/gracedb/graceproj/static/"
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
STATICFILES_DIRS = ()
# XXX The following Log settings are for a performance metric.
import logging
LOG_ROOT = '/home/fzhang/gracedb/logs'
# Filter objects to separate out each level of alert.
class infoOnlyFilter(logging.Filter):
def filter(self,record):
if record.levelname=='INFO':
return 1
return 0
LOGGING = {
'version': 1,
'disable_existing_loggers' : True,
'formatters': {
'simple': {
'format': '%(asctime)s: %(message)s',
'datefmt': '%Y-%m-%dT%H:%M:%S',
},
},
'handlers': {
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'performance_file': {
'class': 'logging.FileHandler',
'formatter': 'simple',
'filename': '%s/gracedb_performance.log' % LOG_ROOT,
},
},
'loggers': {
'django': {
'handlers': ['null'],
'propagate': True,
'level': 'INFO',
},
'middleware': {
'handlers': ['performance_file'],
'propagate': True,
'level': 'INFO',
},
},
}
CONFIG_NAME = "DEVELOPMENT"
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ALERT_EMAIL_FROM = "Dev Alert <root@moe.phys.uwm.edu>"
ALERT_EMAIL_TO = [
"Brian Moe <bmoe@gravity.phys.uwm.edu>",
]
ALERT_EMAIL_BCC = ["bmoe@uwm.edu"]
ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@moe.phys.uwm.edu>"
ALERT_TEST_EMAIL_TO = [
"Brian Moe <bmoe@gravity.phys.uwm.edu>",
]
# Don't sent out non-test XMPP alerts on dev box!
XMPP_ALERT_CHANNELS = [
'test_omega',
'test_mbtaonline',
'test_cwb',
'test_lowmass',
]
# SkyAlert
SKYALERT_IVORN_PATTERN = "ivo://ligo.org/gracedb#%s-dev"
# Latency histograms. Where they go and max latency to bin.
LATENCY_REPORT_DEST_DIR = "/home/bmoe/data/latency"
LATENCY_REPORT_WEB_PAGE_FILE_PATH = LATENCY_REPORT_DEST_DIR + "/latency.inc"
# Uptime reporting
UPTIME_REPORT_DIR = "/home/bmoe/data/uptime"
SITE_ID = 1
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"/home/bmoe/gracedb/templates",
)
CONFIG_NAME = "ER2"
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default' : {
'NAME' : 'er2',
'ENGINE' : 'django.db.backends.mysql',
'USER' : 'er2',
'PASSWORD' : 'weasel',
}
}
ALERT_EMAIL_FROM = "Dev Alert <root@moe.phys.uwm.edu>"
ALERT_EMAIL_TO = [
"Brian Moe <bmoe@gravity.phys.uwm.edu>",
]
ALERT_EMAIL_BCC = ["bmoe@uwm.edu"]
ALERT_TEST_EMAIL_FROM = "Dev Test Alert <root@moe.phys.uwm.edu>"
ALERT_TEST_EMAIL_TO = [
"Brian Moe <bmoe@gravity.phys.uwm.edu>",
]
XMPP_ALERT_CHANNELS = [
]
# SkyAlert
SKYALERT_IVORN_PATTERN = "ivo://ligo.org/gracedb#%s-dev-er2"
# Latency histograms. Where they go and max latency to bin.
LATENCY_REPORT_DEST_DIR = "/home/bmoe/data/latency"
SITE_ID = 4
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"/home/bmoe/ER2/templates",
)
SHIB_AUTHENTICATION_SESSION_INITIATOR = 'https://archie.phys.uwm.edu/Shibboleth.sso/Login'
CONFIG_NAME = "PRODUCTION"
SITE_ID = 3
EMAIL_HOST = 'localhost'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
CONFIG_NAME = "STAGE"
SITE_ID = 3
EMAIL_HOST = 'localhost'
MEDIA_ROOT = '/home/gracedb/gracestage/static/'
TEMPLATE_DIRS = (
"/home/gracedb/gracestage/templates",
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment