Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
GraceDB
GraceDB Server
Commits
191367fa
Commit
191367fa
authored
10 years ago
by
Branson Craig Stephens
Browse files
Options
Downloads
Patches
Plain Diff
Initiated branch for djnago updates.
parent
bf64fc85
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
settings/__init__.py
+3
-0
3 additions, 0 deletions
settings/__init__.py
settings/update.py
+227
-0
227 additions, 0 deletions
settings/update.py
wsgi/update.wsgi
+25
-0
25 additions, 0 deletions
wsgi/update.wsgi
with
255 additions
and
0 deletions
settings/__init__.py
+
3
−
0
View file @
191367fa
...
...
@@ -29,6 +29,9 @@ configs = {
'
/home/branson/gracedbdev
'
:
'
branson
'
,
'
/home/branson/gracedbdev/gracedb
'
:
'
branson
'
,
'
/home/branson/djangoupdate
'
:
'
update
'
,
'
/home/branson/djangoupdate/gracedb
'
:
'
update
'
,
"
/home/gracedb/gracestage
"
:
"
stage
"
,
}
...
...
This diff is collapsed.
Click to expand it.
settings/update.py
0 → 100644
+
227
−
0
View file @
191367fa
CONFIG_NAME
=
"
Update
"
DEBUG
=
True
TEMPLATE_DEBUG
=
DEBUG
DATABASES
=
{
'
default
'
:
{
'
NAME
'
:
'
gracedb
'
,
'
ENGINE
'
:
'
django.db.backends.mysql
'
,
'
USER
'
:
'
branson
'
,
'
PASSWORD
'
:
'
thinglet
'
,
}
}
MEDIA_URL
=
"
/update-static/
"
STATIC_ROOT
=
"
/home/branson/djangoupdate/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/djangoupdate/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,
# },
},
}
This diff is collapsed.
Click to expand it.
wsgi/update.wsgi
0 → 100644
+
25
−
0
View file @
191367fa
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
# Sandbox libs here, if required.
#
sys.path.insert(1,'/home/branson/djangoupdate')
sys.path.insert(1,'/home/branson/update_env/lib/python2.7/site-packages')
# Scott's Shib app uses loggers.
import logging
logging.basicConfig()
os.environ['MPLCONFIGDIR']='/home/branson/logs/'
#logging.basicConfig(level=logging.DEBUG,
# format='%(asctime)s %(levelname)s %(message)s',
# filename='/tmp/myapp.log',
# filemode='w')
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment