InvalidString.__mod__()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
from chat.settings_base import *
2
import sslserver
3
import logging.config
4
5
DEBUG = True
6
TEMPLATE_DEBUG = True
7
SECRET_KEY = '8ou!cqb1yd)6c4h0i-cxjo&@@+04%4np6od8qn+z@5b=6)!v(o'
8
class InvalidString(str):
9
	def __mod__(self, other):
10
		from django.template.base import TemplateSyntaxError
11
		raise TemplateSyntaxError(
12
			"Undefined variable or unknown value for: %s" % other)
13
14
API_ADDRESS_PATTERN = ''.join((WEBSOCKET_PROTOCOL, '://%s:', API_PORT, '/?id='))
15
16
TEMPLATE_STRING_IF_INVALID = InvalidString("%s")
17
TEMPLATES[0]['OPTIONS']['loaders'] = [
18
	'django.template.loaders.filesystem.Loader',
19
	'django.template.loaders.app_directories.Loader',
20
]
21
CRT_PATH = os.sep.join((sslserver.__path__[0], "certs", "development.crt"))
22
KEY_PATH = os.sep.join((sslserver.__path__[0], "certs", "development.key"))
23
TORNADO_SSL_OPTIONS = {
24
	"certfile": CRT_PATH,
25
	"keyfile": KEY_PATH
26
}
27
INSTALLED_APPS = INSTALLED_APPS + ('sslserver',)
28
LOGGING['handlers'] = console_handlers
29
LOGGING['loggers'] = {
30
	'': {
31
		'handlers': ['default', ],
32
		'level': 'DEBUG',
33
		'propagate': False,
34
	},
35
}
36
37
# Don't close socket if we're in debug
38
PING_CLOSE_JS_DELAY = 100000
39
40
logging.config.dictConfig(LOGGING)
41
42
43
44