-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
28 lines (21 loc) · 893 Bytes
/
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
# config.py
import os
BASEDIR = os.path.abspath(os.path.dirname(__file__))
class Config(object):
FLASK_ENV = 'development'
DEBUG = False
TESTING = False
SECRET_KEY = os.getenv('SECRET_KEY', default='BAD_SECRET_KEY')
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Since SQLAlchemy 1.4.x has removed support for the 'postgres://' URI scheme,
# update the URI to the postgres database to use the supported 'postgresql://' scheme
if os.getenv('DATABASE_URL'):
SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL').replace("postgres://", "postgresql://", 1)
else:
SQLALCHEMY_DATABASE_URI = f"sqlite:///{os.path.join(BASEDIR, 'instance', 'benthle.db')}"
SQLALCHEMY_TRACK_MODIFICATIONS = False
MAPS_GENERATION_IN_PROGRESS = False
class ProductionConfig(Config):
FLASK_ENV = 'production'
class DevelopmentConfig(Config):
DEBUG = True