forked from Cal-CS-61A-Staff/oh-queue
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
36 lines (26 loc) · 1.05 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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
ENV = os.getenv('OH_QUEUE_ENV', 'dev')
if ENV in ('dev', 'staging'):
DEBUG = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
elif ENV == 'prod':
DEBUG = False
if ENV in ('dev', 'prod'):
SECRET_KEY = 'dev'
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'sqlite:///' + os.path.join(basedir, 'app.db')).replace('mysql://', 'mysql+pymysql://')
else:
SECRET_KEY = os.getenv('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL').replace('mysql://', 'mysql+pymysql://')
SQLALCHEMY_TRACK_MODIFICATIONS = False
DATABASE_CONNECT_OPTIONS = {}
#if ENV == 'prod':
# SQLALCHEMY_POOL_SIZE = 5
LOCAL_TIMEZONE = os.getenv('TIMEZONE', 'US/Pacific')
AUTH_KEY = os.getenv("AUTH_KEY")
AUTH_SECRET = os.getenv("AUTH_SECRET")
OK_KEY = os.getenv('OK_KEY', 'local-dev-email')
OK_SECRET = os.getenv('OK_SECRET', 'KH0mvknMUWT5w3U7zvz6wsUQZoy6UmQ')
OK_SERVER_URL = os.getenv('OK_DEPLOYMENT', 'https://okpy.org')
HOST = os.getenv('HOST', '127.0.0.1')
PORT = int(os.getenv('PORT', '5000'))