-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
24 lines (19 loc) · 745 Bytes
/
config.py
File metadata and controls
24 lines (19 loc) · 745 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
import os
class DefaultConfig(object):
def __init__(self):
self.DEBUG = True
self.SQLALCHEMY_DATABASE_URI = 'postgresql://@localhost/flask_todo'
self.DATABASE_CONNECT_OPTIONS = {}
self.SQLALCHEMY_TRACK_MODIFICATIONS = False
self.SECRET_KEY = "flask-todo"
self.SERVER_NAME = "0.0.0.0:5001"
class ProductionConfig(DefaultConfig):
def __init__(self):
super(ProductionConfig, self).__init__()
self.DEBUG = False
self.SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
self.SERVER_NAME = "flask-todo-ornek.herokuapp.com"
ENV = os.getenv('ENVIRONMENT', 'Local')
configuration = DefaultConfig()
if ENV == "Production":
configuration = ProductionConfig()