-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
28 lines (19 loc) · 908 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
import dotenv
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'piscan'))
dotenv.load_dotenv(os.path.join(PROJECT_ROOT, ".env"))
class Config:
MIGRATIONS_DIR_PATH = os.path.join(PROJECT_ROOT, "database", "migrations")
SCAN_FILES_DIR_PATH = os.path.join(PROJECT_ROOT, "files", "scans")
SCAN_FILES_THUMBNAILS_DIR_PATH = os.path.join(PROJECT_ROOT, "files", "thumbnails")
APP_PORT = 8000
APP_HOST = "0.0.0.0"
TESTING = 0
DEBUG_MODE = int(os.getenv("DEBUG", 0))
DATABASE_URI = f"sqlite:////{PROJECT_ROOT}/database/app.sqlite3"
REDIS_URI = "127.0.0.1" if (DEBUG_MODE or TESTING) else "redis"
REDIS_PORT = "6000"
HOST_DOCS = int(os.getenv("HOST_DOCS", 0))
SWAGGER_SCHEMA_PATH = os.path.join(PROJECT_ROOT, "swagger.json")
SWAGGER_SERVERS = os.getenv("SWAGGER_SERVERS")