-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.py.template
85 lines (71 loc) · 2.45 KB
/
config.py.template
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
import os
# Canvas API URL (e.g. 'http://example.com/api/v1/')
API_URL = "http://example.com/api/v1/"
# Canvas API Key
API_KEY = "CHANGEME"
# A list of domains that are allowed to use the tool.
# (e.g. ['example.com', 'example.edu'])
ALLOWED_CANVAS_DOMAINS = ["example.edu"]
# The maximum amount of objects the Canvas API will return per page (usually 100)
MAX_PER_PAGE = 100
# A secret key used by Flask for signing. KEEP THIS SECRET!
# (e.g. 'Ro0ibrkb4Z4bZmz1f5g1+/16K19GH/pa')
SECRET_KEY = "CHANGEME"
LTI_TOOL_ID = "CHANGEME" # A unique ID for the tool
# URI for database. (e.g. 'mysql://root:root@localhost/quiz_extensions')
SQLALCHEMY_DATABASE_URI = ""
SQLALCHEMY_TRACK_MODIFICATIONS = False
GOOGLE_ANALYTICS = "" # The Google Analytics ID to use.
# URL for the redis server (e.g. 'redis://localhost:6379')
REDIS_URL = "redis://localhost:6379"
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {
"format": "%(asctime)s [%(levelname)s] {%(filename)s:%(lineno)d} %(message)s"
},
"bare": {"format": "%(message)s"},
},
"handlers": {
"console": {
"level": "DEBUG",
"formatter": "standard",
"class": "logging.StreamHandler",
},
"file": {
"level": "INFO",
"formatter": "standard",
"class": "logging.handlers.RotatingFileHandler",
"filename": "logs/quiz_ext.log",
"maxBytes": 1024 * 1024 * 5, # 5 MB
"backupCount": 5,
},
},
"loggers": {
"app": {"handlers": ["console", "file"], "level": "DEBUG", "propagate": True}
},
}
TESTING_API_URL = "example.edu" # Used only to run tests
CONSUMER_KEY = os.environ.get("CONSUMER_KEY", "key")
SHARED_SECRET = os.environ.get("SHARED_SECRET", "secret")
# Configuration for LTI
PYLTI_CONFIG = {
"consumers": {
CONSUMER_KEY: {"secret": SHARED_SECRET}
# Feel free to add more key/secret pairs for other consumers.
},
"roles": {
# Maps values sent in the lti launch value of "roles" to a group
# Allows you to check LTI.is_role('staff') for your user
"staff": [
"urn:lti:instrole:ims/lis/Administrator",
"Instructor",
# 'ContentDeveloper',
# 'urn:lti:role:ims/lis/TeachingAssistant'
]
},
}
# Chrome 80 SameSite=None; Secure fix
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_SAMESITE = "None"