-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
29 lines (25 loc) · 1.06 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
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv()
class Config(object):
SECRET_KEY = os.getenv('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'data.sqlite')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_POOL_RECYCLE = 299 # may be solution of Operational Error
LOG_TO_STDOUT = os.getenv('LOG_TO_STDOUT')
SQLALCHEMY_ENABLE_POOL_PRE_PING = True
POSTS_PER_PAGE = 30
MAIL_SERVER = os.getenv('MAIL_SERVER')
MAIL_PORT = int(os.getenv('MAIL_PORT'))
MAIL_USE_TLS = os.getenv('MAIL_USE_TLS') is not None
MAIL_USERNAME = os.getenv('MAIL_USERNAME')
MAIL_PASSWORD = os.getenv('MAIL_PASSWORD')
ADMINS = [(os.getenv('ADMIN_MAIL'))]
GOOGLE_CLIENT_ID = os.getenv('GOOGLE_CLIENT_ID')
REDIRECT_URI = os.getenv('REDIRECT_URI')
CODEHUB_MAIL_SENDER = 'CodeHub <[email protected]>'
class Development(Config):
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
DEBUG = True