-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
25 lines (19 loc) · 772 Bytes
/
config.py
File metadata and controls
25 lines (19 loc) · 772 Bytes
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
import os
base_dir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
DEBUG=False
TESTING=False
class DevelopmentConfig(Config):
DEBUG=True
FALSK_ENV='development'
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'sqlite:///' + os.path.join(base_dir, 'books.db')
SQLALCHEMY_TRACK_MODIFICATIONS=False
class TestConfig(Config):
DEBUG=True
TESTING=True
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'sqlite:///' + os.path.join(base_dir, 'test_books.db')
SQLALCHEMY_TRACK_MODIFICATIONS=False
class ProductionConfig(Config):
pass
create_config = dict(dev=DevelopmentConfig, test=TestConfig, prod=ProductionConfig)