forked from WCI-Computer-Science/WCI-Walks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigs.py
42 lines (37 loc) · 1.4 KB
/
configs.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
import os
from datetime import datetime
try:
import secrets
SECRET_KEY = secrets.secret_key
GOOGLE_CLIENT_ID = secrets.google_client_id
GOOGLE_CLIENT_SECRET = secrets.google_client_secret
except (ModuleNotFoundError, AttributeError):
try:
SECRET_KEY = os.environ["SECRET_KEY"]
GOOGLE_CLIENT_ID = os.environ["GOOGLE_CLIENT_ID"]
GOOGLE_CLIENT_SECRET = os.environ["GOOGLE_CLIENT_SECRET"]
except KeyError: # Probably running on travis, no need for real values here, but warn anyways
print("Warn: Could not load secrets, using bogus values.")
SECRET_KEY = ""
GOOGLE_CLIENT_ID = ""
GOOGLE_CLIENT_SECRET = ""
try:
import secrets
DB = os.environ["DATABASE_URL"]
DONT_LOAD_DB = False
except KeyError:
try:
DB = secrets.database_url
DONT_LOAD_DB = False
except (ModuleNotFoundError, AttributeError): # Probably running on travis, no need for real values here, but warn anyways
print("Warn: Could not load DATABASE_URL, using bogus values.")
DB = ""
DONT_LOAD_DB = True
EOS_DATE = datetime(2030, 1, 1)
GOOGLE_DISCOVERY_URL = "https://accounts.google.com/.well-known/openid-configuration"
OAUTH_SCOPES = [
"openid",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/fitness.location.read"
]