forked from LibraryOfCongress/chronam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings_template.py
140 lines (106 loc) · 3.31 KB
/
settings_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import os
import logging
import subprocess
def abs_path(path):
import os
_root = os.path.abspath(os.path.dirname(__file__))
return os.path.join(_root, path)
DIRNAME = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
TIME_ZONE = 'America/New_York'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_ROOT = ''
MEDIA_URL = ''
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
STATIC_URL = '/media/'
STATIC_ROOT = os.path.join(DIRNAME, '.static-media')
ROOT_URLCONF = 'chronam.urls'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'chronam',
'USER': 'chronam',
'PASSWORD': 'pick_one',
}
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'px2@!q2(m5alb$0=)h@u*80mmf9cd-nn**^y4j2j&+_8h^n_0f'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'chronam.core.middleware.TooBusyMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'chronam.core.context_processors.extra_request_info',
'chronam.core.context_processors.newspaper_info',
)
TEMPLATE_DIRS = (
os.path.join(DIRNAME, 'templates'),
)
INSTALLED_APPS = (
# 'lc',
# 'chronam.example',
# 'chronam.loc',
'south',
'django.contrib.humanize',
'django.contrib.staticfiles',
'djcelery',
'djkombu',
'chronam.core',
)
BROKER_TRANSPORT = "django"
THUMBNAIL_WIDTH = 360
DEFAULT_TTL_SECONDS = 86400 # 1 day
PAGE_IMAGE_TTL_SECONDS = 60 * 60 * 24 * 7 * 2 # 2 weeks
API_TTL_SECONDS = 60 * 60 # 1 hour
FEED_TTL_SECONDS = 60 * 60 * 24 * 7
USE_TIFF = False
SOUTH_TESTS_MIGRATE = False
ESSAYS_FEED = "http://ndnp-essays.rdc.lctl.gov/feed/"
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': '/var/tmp/django_cache',
'TIMEOUT': 4838400, # 2 months
}
}
IS_PRODUCTION = False
CTS_USERNAME = 'username'
CTS_PASSWORD = 'password'
CTS_PROJECT_ID = 'ndnp'
CTS_QUEUE = 'ndnpingestqueue'
CTS_SERVICE_TYPE = 'ingest.NdnpIngest.ingest'
CTS_URL = "https://cts.loc.gov/transfer/"
MAX_BATCHES = 0
import multiprocessing
#TOO_BUSY_LOAD_AVERAGE = 1.5 * multiprocessing.cpu_count()
TOO_BUSY_LOAD_AVERAGE = 64
SOLR = "http://localhost:8983/solr"
SOLR_LANGUAGES = ("eng", "fre", "spa", "ger", "ita",)
DOCUMENT_ROOT = "/opt/chronam/static"
STORAGE = '/opt/chronam/data/'
STORAGE_URL = '/data/'
BATCH_STORAGE = os.path.join(STORAGE, "batches")
BIB_STORAGE = os.path.join(STORAGE, "bib")
OCR_DUMP_STORAGE = os.path.join(STORAGE, "ocr")
COORD_STORAGE = os.path.join(STORAGE, "word_coordinates")
TEMP_TEST_DATA = os.path.join(STORAGE, "temp_test_data")
BASE_CRUMBS = [{'label':'Home', 'href': '/'}]
TOPICS_ROOT_URL = 'http://www.loc.gov/rr/news/topics'
TOPICS_SUBJECT_URL = '/topicsSubject.html'
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']