-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-template.py
71 lines (67 loc) · 2.6 KB
/
config-template.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
class Config(object):
"""
The configuration used for a production environment.
"""
# analysis path
ANALYSIS_PATH = 'ANALYSIS_DIR_PATH_HERE'
# data path
DATA_PATH = 'DATA_DIR_PATH_HERE'
# whether or not to log debugging output from Flask
DEBUG = False
# whether or not to setup Flask in testing mode
TESTING = False
# AWS Access Key ID
AWS_ACCESS_KEY_ID = 'ADD_VALUE_HERE'
# AWS Secret Access Key
AWS_SECRET_ACCESS_KEY = 'ADD_VALUE_HERE'
# AWS SES region
AWS_REGION = 'us-east-1'
# Google Maps JavaScript API Key
MAPS_API_KEY = 'ADD_VALUE_HERE'
# the username to use to access the database
DB_USER = 'ADD_VALUE_HERE'
# the password for the user
DB_PASS = 'ADD_VALUE_HERE'
# the name of the database
DB_NAME = 'shellcast'
# the path prefix to the location of the Unix socket used to connect to the Cloud SQL database
DB_UNIX_SOCKET_PATH_PREFIX = '/cloudsql/'
# the name of the Cloud SQL instance to connect to
CLOUD_SQL_INSTANCE_NAME = 'ncsu-shellcast:us-east1:ncsu-shellcast-database'
# whether or not to track modifications in SQLAlchemy
SQLALCHEMY_TRACK_MODIFICATIONS = False
# various configuration options for SQLAlchemy
SQLALCHEMY_ENGINE_OPTIONS = {
'pool_size': 5, # max number of permanent connections in the connection pool
'max_overflow': 2, # number of additional connections that can be created over the pool_size
'pool_timeout': 30, # max number of seconds to wait to get a new connection from the pool
'pool_recycle': 1800, # max number of seconds a connection can persist
}
# the URI used to connect to the database
@property
def SQLALCHEMY_DATABASE_URI(self):
return 'mysql+pymysql://{}:{}@/{}?unix_socket={}{}'.format(self.DB_USER, self.DB_PASS, self.DB_NAME, self.DB_UNIX_SOCKET_PATH_PREFIX, self.CLOUD_SQL_INSTANCE_NAME)
class DevConfig(Config):
"""
The configuration used for local development.
"""
# whether or not to log debugging output from Flask
DEBUG = True
# the IP address of the web server
HOST = '127.0.0.1'
# the port that the web server should listen on
PORT = 3361
# the name of the database
DB_NAME = 'shellcast_dev'
# the path prefix to the location of the Unix socket used to connect to the Cloud SQL database
DB_UNIX_SOCKET_PATH_PREFIX = './cloudsql/'
class TestConfig(Config):
"""
The configuration used for unit testing.
"""
# whether or not to setup Flask in testing mode
TESTING = True
# the name of the database
DB_NAME = 'shellcast_testing'
# the path prefix to the location of the Unix socket used to connect to the Cloud SQL database
DB_UNIX_SOCKET_PATH_PREFIX = './cloudsql/'