forked from Cal-CS-61A-Staff/seating
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
41 lines (30 loc) · 1.31 KB
/
config.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
# Define the application directory
import os
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# Define the database
# We are working with SQLite for development, mysql for production
# [development should be changed to mysql in the future]
if os.getenv('FLASK_ENV') == 'development':
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'app.db')
else:
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL').replace('mysql://', 'mysql+pymysql://')
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Configure timezone
LOCAL_TIMEZONE = os.getenv('TIMEZONE', 'US/Pacific')
# Configure other environment variables
OK_CLIENT_ID = os.getenv('OK_CLIENT_ID')
OK_CLIENT_SECRET = os.getenv('OK_CLIENT_SECRET')
GOOGLE_OAUTH2_CLIENT_ID = os.getenv('GOOGLE_CLIENT_ID')
GOOGLE_OAUTH2_CLIENT_SECRET = os.getenv('GOOGLE_CLIENT_SECRET')
# Email setup. Domain environment is for link in email.
SENDGRID_API_KEY = os.getenv('SENDGRID_API_KEY')
DOMAIN = os.getenv('DOMAIN', 'https://seating.test.org')
PHOTO_DIRECTORY = os.getenv('PHOTO_DIRECTORY')
# Used for redirects and auth: <domain>/COURSE/EXAM
COURSE = os.getenv('COURSE', 'cal/test/fa18')
EXAM = os.getenv('EXAM')
TEST_LOGIN = os.getenv('TEST_LOGIN')
# Secret key for signing cookies
SECRET_KEY = os.getenv('SECRET_KEY', 'development')
# Admin user
ADMIN = os.getenv('ADMIN')