-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
53 lines (38 loc) · 1.25 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
"""Flask configuration"""
from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv(path.join(basedir, ".env"))
class Config:
"""Base configuration"""
FLASK_APP = "wsgi.py"
# FLASK_ENV = "development"
FLASK_ENV = "production"
SECRET_KEY = environ.get("SECRET_KEY")
POSTS_PER_PAGE = 8
POSTS_PER_PAGE = 12
S3_BUCKET = environ.get("S3_BUCKET")
S3_BUCKET_TEMP = environ.get("S3_BUCKET_TEMP")
S3_KEY = environ.get("S3_KEY")
S3_SECRET = environ.get("S3_SECRET")
SESSION_PERMANENT = False
SESSION_TYPE = "filesystem"
SQLALCHEMY_TRACK_MODIFICATIONS = False
STATIC_FOLDER = "static"
TEMPLATES_FOLDER = "templates"
TEMPLATES_AUTO_RELOAD = True
LOG_TO_STDOUT = 1
class ProdConfig(Config):
"""Production configuration"""
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = environ.get("PROD_DATABASE_URI", "").replace(
"postgres://", "postgresql://") or \
"sqlite:///" + path.join(basedir, "app.db")
SQLALCHEMY_ECHO = False
class DevConfig(Config):
"""Development configuration"""
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = "sqlite:///database.db"
SQLALCHEMY_ECHO = False