-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.py
34 lines (26 loc) · 1003 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
import os
import random
import string
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
"""All application configurations"""
# Secret key
SECRET_KEY = ''.join(
random.choice(
string.ascii_lowercase +
string.digits) for _ in range(128))
# Database configurations
SQLALCHEMY_DATABASE_NAME = 'spotisub.db'
SQLALCHEMY_DATABASE_PATH = 'sqlite:///' + os.path.join(basedir, 'cache')
SQLALCHEMY_DATABASE_URI = os.path.join(
SQLALCHEMY_DATABASE_PATH, SQLALCHEMY_DATABASE_NAME)
SQLALCHEMY_TRACK_MODIFICATIONS = False
SCHEDULER_API_ENABLED = True
SCHEDULER_API_PREFIX = "/api/v1/scheduler"
SCHEDULER_EXECUTORS = {
"default": {
"type": "threadpool",
"max_workers": 10}}
APPLICATION_ROOT = os.environ.get("APPLICATION_ROOT", "")
LOGIN_DISABLED = os.environ.get("LOGIN_DISABLED", "0") == "1"