-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
40 lines (27 loc) · 1.22 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
import os
from dotenv import load_dotenv
load_dotenv() # Load environment variables from .env file
class Config:
# Flask settings
SECRET_KEY = os.getenv('SECRET_KEY')
SESSION_TYPE = 'filesystem'
# Spotify API settings
SPOTIPY_CLIENT_ID = os.getenv('SPOTIPY_CLIENT_ID')
SPOTIPY_CLIENT_SECRET = os.getenv('SPOTIPY_CLIENT_SECRET')
SPOTIPY_REDIRECT_URI = os.getenv('SPOTIPY_REDIRECT_URI')
# Admin settings
ADMIN_KEYWORD = os.getenv('ADMIN_KEYWORD')
# Application settings
PORT = int(os.getenv('PORT', 5000))
TIP_QR_CODE_PATH = '/static/tip-qr.png'
# Spotify API scope
SPOTIFY_SCOPE = 'user-read-private user-read-email playlist-modify-public playlist-modify-private user-read-playback-state user-modify-playback-state user-read-currently-playing'
# Debug mode (set to False in production)
DEBUG = os.getenv('FLASK_DEBUG', 'False').lower() in ('true', '1', 't')
# Cooldown period for tracks (in seconds)
TRACK_COOLDOWN_PERIOD = 1200 # 20 minutes
# Logging configuration
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
# Session expiration time (in seconds)
SESSION_EXPIRATION_TIME = 24 * 60 * 60 # 24 hours in seconds
PREFERRED_URL_SCHEME = 'https'