-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.py
42 lines (30 loc) · 1.2 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
"""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:
"""Global configuration variables."""
# General Config
APP_NAME = "pythonmyadmin"
ENVIRONMENT = environ.get("ENVIRONMENT")
# Flask Config
FLASK_APP = environ.get("FLASK_APP")
SECRET_KEY = environ.get("SECRET_KEY")
FLASK_DEBUG = environ.get("FLASK_DEBUG")
# Database
SQLALCHEMY_DATABASE_URI = environ.get("SQLALCHEMY_DATABASE_URI")
SQLALCHEMY_DATABASE_HOST = environ.get("SQLALCHEMY_DATABASE_HOST")
SQLALCHEMY_DATABASE_TABLE = environ.get("SQLALCHEMY_DATABASE_TABLE")
SQLALCHEMY_DATABASE_NAME = environ.get("SQLALCHEMY_DATABASE_NAME")
SQLALCHEMY_CONNECT_ARGS = {"ssl": {"ca": "./creds/ca-certificate.crt"}}
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Flask-Assets
LESS_BIN = environ.get("LESS_BIN")
ASSETS_DEBUG = environ.get("ASSETS_DEBUG")
LESS_RUN_IN_DEBUG = environ.get("LESS_RUN_IN_DEBUG")
# Static Assets
STATIC_FOLDER = "static"
TEMPLATES_FOLDER = "templates"
COMPRESSOR_DEBUG = environ.get("COMPRESSOR_DEBUG")
settings = Config()