-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
77 lines (66 loc) · 3.32 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
65
66
67
68
69
70
71
72
73
74
75
76
77
""" Configuration file. """
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
""" Base configuration class. """
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_TOKEN')
SQLALCHEMY_TRACK_MODIFICATIONS = False
LOG_TO_STDOUT = os.environ.get('LOG_TO_STDOUT')
# SQLALCHEMY_RECORD_QUERIES = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
BOOKCOVER_DIR = '/static/images/books/'
MAGAZINECOVER_DIR = '/static/images/magazines/'
PERSONIMG_DIR = '/static/images/people/'
MAGAZINECOVER_IMG = '/static/images/magazinse/'
ENV = os.environ.get('FLASK_ENV') or 'debug'
class DevConfig(Config): # pylint: disable=too-few-public-methods
""" Development configuration class. """
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_TOKEN')
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'suomisf.db')
BOOKCOVER_SAVELOC = '/home/mep/src/suomisf/app/static/images/books/'
PERSONIMG_SAVELOC = '/home/mep/src/suomisf/app/static/images/people/'
MAGAZINECOVER_SAVELOC = \
'/home/mep/src/suomisf/app/static/images/magazines/'
class ProdConfig(Config): # pylint: disable=too-few-public-methods
""" Production configuration class. """
DEBUG = False
SQLALCHEMY_ECHO = False
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_TOKEN')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite://' + os.path.join(basedir, 'suomisf.db')
BOOKCOVER_SAVELOC = '/home/mep/suomisf/app/static/images/books/'
PERSONIMG_SAVELOC = '/home/mep/suomisf/app/static/images/people/'
MAGAZINECOVER_SAVELOC = '/home/mep/suomisf/app/static/images/magazines/'
class StagingConfig(Config): # pylint: disable=too-few-public-methods
""" Staging configuration class. """
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_TOKEN')
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite://' + os.path.join(basedir, 'suomisf.db')
BOOKCOVER_SAVELOC = '/home/mep/src/suomisf/app/static/images/books/'
PERSONIMG_SAVELOC = '/home/mep/src/suomisf/app/static/images/people/'
MAGAZINECOVER_SAVELOC = \
'/home/mep/src/suomisf/app/static/images/magazines/'
class TestingConfig(Config): # pylint: disable=too-few-public-methods
""" Testing configuration class. """
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_TOKEN')
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL_TEST') or \
'sqlite://' + os.path.join(basedir, 'suomisf.db')
BOOKCOVER_SAVELOC = '/home/mep/src/suomisf/app/static/images/books/'
PERSONIMG_SAVELOC = '/home/mep/src/suomisf/app/static/images/people/'
MAGAZINECOVER_SAVELOC = \
'/home/mep/src/suomisf/app/static/images/magazines/'