-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
executable file
·64 lines (48 loc) · 1.57 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
DEBUG = False
SECRET_KEY = 'this-really-needs-to-be-changed'
TESTING = False
CSRF_ENABLED = True
SECURITY_PASSWORD_SALT = 'salt-licker'
# SQLAlchemy
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_POOL_RECYCLE = 280
SQLALCHEMY_TRACK_MODIFICATIONS = False
# mail settings
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
CONTACT_EMAIL = os.environ['CONTACT_EMAIL']
# gmail authentication
MAIL_USERNAME = os.environ['APP_MAIL_USERNAME']
MAIL_PASSWORD = os.environ['APP_MAIL_PASSWORD']
# mail accounts
MAIL_DEFAULT_SENDER = os.environ['MAIL_DEFAULT_SENDER']
# flask user
USER_ENABLE_CONFIRM_EMAIL = True
# remote logging
LOGGING_URL = os.environ['LOGGING_URL']
class DevelopmentConfig(Config):
DEBUG = True
TESTING = False
ROOT_URL = 'http://127.0.0.1:5000'
DATABASE = '__database.db'
DATABASE_PATH = os.path.join(basedir, DATABASE)
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + DATABASE_PATH
class ProductionConfig(Config):
DEBUG = False
ROOT_URL = None
class StagingConfig(Config):
DEBUG = False
ROOT_URL = ''
class TestingConfig(Config):
DEBUG = True
TESTING = True
ROOT_URL = 'http://127.0.0.1:5000'
DATABASE = 'tests.db'
DATABASE_PATH = os.path.join(basedir, DATABASE)
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + DATABASE_PATH