-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
61 lines (49 loc) · 1.85 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
# config.py
# Jake Malley
# 15/01/2015
# Imports
import os
"""
Defines a default configuration class DefaultConfig
and classes for production and development configuration:
ProductionConfig and DevelopmentConfig respectively.
"""
class DefaultConfig(object):
"""
Default configuration settings. All other
configuration class should inherit from this class.
"""
# Disables debugging by default.
DEBUG = False
# Specify a secret key. (Will be different in production.)
SECRET_KEY = '\t\x0b\xcf\xa3Fpj\x18\x04\x83\xb5\x0b\xe7\xa2\x0c\x12\x04B\x0c\x87\xfeLkS'
# SQLite Database.
SQLALCHEMY_DATABASE_URI = "sqlite:///"+os.path.abspath("training_log_database.db")
# Options for member sign up.
# Automatically approve users when they sign up.
AUTO_APPROVE = False
# Automatically make users administrators when they sign up.
AUTO_ADMIN = False
class DevelopmentConfig(DefaultConfig):
"""
Configuration to be used in development environments only!
(Don't test your code in production with this configuration!)
"""
# Warn the user so they know they're using the development configuration when running the server.
print(" * Warning using development configuration.")
# Enables debugging in development environments
DEBUG = True
class ProductionConfig(DefaultConfig):
"""
Configuration to be used in production environments.
"""
# Explicitly make sure debugging is disabled.
DEBUG = False
# SQLite Database.
#SQLALCHEMY_DATABASE_URI = "sqlite:///"+os.path.abspath("training_log_database.db")
# Specify a absolute path for SQLite in /tmp (Needed when running with uWSGI)
SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/training_log_database.db"
# Set the host and port.
# (Only used when running the app via manage.py)
HOST = '0.0.0.0'
PORT = 8080