-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
40 lines (28 loc) · 1.01 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
import os
class BaseConfig(object):
# general
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = os.environ.get('SECRET_KEY')
SECURITY_PASSWORD_SALT = os.environ.get('SECURITY_PASSWORD_SALT')
# mail settings
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
# mail account
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
MAIL_DEFAULT_SENDER = os.environ.get('MAIL_DEFAULT_SENDER')
# misc
SECONDS_TO_CHANGE_USERNAME = 900 # == 15 minutes for oauth user to change username
class DevelopmentConfig(BaseConfig):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/simple_nickels'
HOST = 'localhost'
PORT = int(os.environ.get('PORT', 5000))
class TestingConfig(DevelopmentConfig):
TESTING = True
SQLALCHEMY_DATABASE_URI = "postgresql://localhost/simple_nickels_test"
WTF_CSRF_ENABLED = False
class ProductionConfig(BaseConfig):
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')