· 7 years ago · Nov 24, 2018, 03:48 AM
1import os
2
3class Config:
4 # Make sure debuging and testing is disabled
5 DEBUG = False
6 TESTING = False
7
8class Development(Config):
9 """
10 Development configuration, all data is lost on appliaction
11 reset, and the secret key is static.
12
13 Don't use this for production.
14 """
15 SECRET_KEY = '123fourfive'
16 SQLALCHEMY_DATABASE_URI = 'sqlite://:memory:'
17
18 # Re-enable debuging and testing.
19 DEBUG = True
20 TESTING = True
21
22 # Display SQL queries
23 SQLALCHEMY_ECHO = True
24
25class Production(Config):
26 """
27 Production configurarion gets its data from the environment
28 """
29 SECRET_KEY = os.environ['SECRET_KEY']
30 SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']