forked from toddbirchard/flasklogin-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
35 lines (25 loc) · 854 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
29
30
31
32
33
34
35
"""Flask app configuration."""
from os import environ, path
from dotenv import load_dotenv
BASE_DIR = path.abspath(path.dirname(__file__))
load_dotenv(path.join(BASE_DIR, ".env"))
class Config:
"""Set Flask configuration from environment variables."""
# General Config
ENVIRONMENT = environ.get("ENVIRONMENT")
# Flask Config
FLASK_APP = "wsgi.py"
FLASK_DEBUG = environ.get("FLASK_DEBUG")
SECRET_KEY = environ.get("SECRET_KEY")
# Flask-SQLAlchemy
SQLALCHEMY_DATABASE_URI = environ.get("SQLALCHEMY_DATABASE_URI")
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Flask-Assets
LESS_BIN = environ.get("LESS_BIN")
ASSETS_DEBUG = False
LESS_RUN_IN_DEBUG = False
# Static Assets
STATIC_FOLDER = "static"
TEMPLATES_FOLDER = "templates"
COMPRESSOR_DEBUG = False