-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
40 lines (28 loc) · 1.08 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
#!/usr/bin/env python
import os
# Find the absolute file path to the top level project directory
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
"""
Base configuration class.
Contains default configuration settings + configuration settings applicable to all environments.
"""
# Default settings
FLASK_ENV = 'development'
DEBUG = False
TESTING = False
WTF_CSRF_ENABLED = True
# Settings applicable to all environments
SECRET_KEY = os.getenv('SECRET_KEY', default='default secret key!')
SQLALCHEMY_TRACK_MODIFICATIONS = False
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(basedir, 'dev.sqlite3')
class TestingConfig(Config):
TESTING = True
WTF_CSRF_ENABLED = False
MAIL_SUPPRESS_SEND = True
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(basedir, 'test.sqlite3')
class ProductionConfig(Config):
FLASK_ENV = 'production'
SQLALCHEMY_DATABASE_URI = os.getenv('PROD_DATABASE_URl', default="sqlite:///" + os.path.join(basedir, 'prod.sqlite3'))