forked from bmg1919/Booktype-py3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselenium_settings.py
More file actions
276 lines (218 loc) · 6.73 KB
/
Copy pathselenium_settings.py
File metadata and controls
276 lines (218 loc) · 6.73 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
import os
import django
from pathlib import Path
BASE_DIR = Path(os.path.abspath(__file__))
# PROFILE
PROFILE_ACTIVE = 'test'
SOUTH_TESTS_MIGRATE = False
SKIP_SOUTH_TESTS = True
# BOOKTYPE
BOOKTYPE_SITE_NAME = 'Booktype site'
BOOKTYPE_SITE_DIR = 'tests'
THIS_BOOKTYPE_SERVER = ''
BOOKTYPE_ROOT = Path(os.path.abspath(__file__)).parent
BOOKTYPE_URL = ''
# BOOKTYPE_URL = 'http://{}'.format(THIS_BOOKTYPE_SERVER)
# E-MAIL OPTIONS
DEFAULT_FROM_EMAIL = 'booktype@booktype.pro'
REPORT_EMAIL_USER = 'report@booktype.pro'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 25
# site_static
import booki
# static
STATIC_ROOT = BOOKTYPE_ROOT.child('static')
STATIC_URL = '{}/static/'.format(BOOKTYPE_URL)
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
BOOKTYPE_ROOT.child(BOOKTYPE_SITE_NAME).child('static'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
'compressor.finders.CompressorFinder'
)
# data
DATA_ROOT = BOOKTYPE_ROOT.child('data')
DATA_URL = '{}/data/'.format(BOOKTYPE_URL)
# profile images
PROFILE_IMAGE_UPLOAD_DIR = 'profile_images/'
# If you don't want to use default profile image you can set your own.
# Place the image inside of /static/images/ directory in your Booktype project directory.
# DEFAULT_PROFILE_IMAGE='anonymous.png'
# book cover images
COVER_IMAGE_UPLOAD_DIR = 'cover_images/'
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
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = False
LOCALE_PATHS = (
BOOKTYPE_ROOT.child(BOOKTYPE_SITE_NAME).child('locale'),
Path(booki.__file__).parent.child('locale'),
Path(booki.__file__).parent.child('booktype').child('locale')
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'enc*ln*vp^o2p1p6of8ip9v5_tt6r#fh2-!-@pl0ur^6ul6e)l'
# Storage for messages framework
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
# 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',
# 'django.template.loaders.eggs.Loader',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"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.tz",
"django.contrib.messages.context_processors.messages",
"django.core.context_processors.csrf"
)
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'booktype.apps.core.middleware.StrictAuthentication',
'booktype.apps.core.middleware.SecurityMiddleware',
)
TEMPLATE_DIRS = (
BOOKTYPE_ROOT.child(BOOKTYPE_SITE_NAME).child('templates'),
Path(booki.__file__).parent.child('templates')
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.messages',
'django.contrib.staticfiles',
'compressor',
'django_celery_results',
# list of booki apps
'booki.editor',
# list of booktype apps
'booktype',
'booktype.apps.core',
'booktype.apps.portal',
'booktype.apps.loadsave',
'booktype.apps.importer',
'booktype.apps.convert',
'booktype.apps.edit',
'booktype.apps.account',
# to be removed
'booki.messaging',
'sputnik',
'booktypecontrol'
)
if django.VERSION[:2] < (1, 6):
TEST_RUNNER = 'discover_runner.DiscoverRunner'
TEST_DISCOVER_TOP_LEVEL = BASE_DIR.parent.parent.child('lib')
TEST_DISCOVER_PATTERN = 'seltest*.py'
if django.VERSION[:2] < (1, 7):
INSTALLED_APPS += ('south', )
BOOKTYPE_CONVERTER_MODULES = (
'booktype.convert.converters',
)
BROKER_URL = 'amqp://guest:guest@localhost:5672/'
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
# DEPRECATED CONFIG
BOOKTYPE_NAME = BOOKTYPE_SITE_NAME
BOOKI_NAME = BOOKTYPE_NAME
BOOKI_ROOT = BOOKTYPE_ROOT
BOOKI_URL = BOOKTYPE_URL
THIS_BOOKI_SERVER = THIS_BOOKTYPE_SERVER
BOOKI_MAINTENANCE_MODE = False
# WEB SITE URL
THIS_BOOKTYPE_SERVER = ''
MEDIA_URL = DATA_URL
# DEBUGGING
DEBUG = TEMPLATE_DEBUG = True
# COMPRESSION
COMPRESS_ENABLED = False
COMPRESS_OFFLINE = False
# PROFILE
# URL ROUTER
ROOT_URLCONF = 'urls'
# DATABASE
DATABASES = {
'default':
{
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': ''
}
}
# E-MAIL
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# CACHE
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# LOGGING
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt': "%d/%b/%Y %H:%M:%S"
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'logging.NullHandler',
}
},
'loggers': {
'django': {
'handlers': ['null'],
'propagate': True,
'level': 'WARN',
},
'django.db.backends': {
'handlers': ['null'],
'level': 'DEBUG',
'propagate': False,
},
'django.request': {
'handlers': ['null'],
'level': 'ERROR',
'propagate': True,
},
'booktype': {
'handlers': ['null'],
'level': 'INFO'
}
}
}
# READ CONFIGURAION
from booktype.utils import config
try:
BOOKTYPE_CONFIG = config.load_configuration()
except config.ConfigurationError:
BOOKTYPE_CONFIG = {}