-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
36 lines (34 loc) · 1.19 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
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
FLASK_ADMIN_SWATCH = 'cerulean'
# MySQL config
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'mysql://root:[email protected]:3306/graduate'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Redis config
CACHE_TYPE = 'redis'
CACHE_REDIS_HOST = '127.0.0.1'
CACHE_REDIS_PORT = '6379'
CACHE_REDIS_URL = 'redis://127.0.0.1:6379'
# Email config
MAIL_SERVER = os.environ.get('MAIL_SERVER')
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
ADMINS = ['[email protected]']
#page config
SENSORS_PER_PAGE = 15
#language support
LANGUAGES = ['zh', 'es']
#cors config
CORS_HEADERS = 'Content-Type'
#Mqtt config
MQTT_BROKER_URL = 'broker.hivemq.com'
MQTT_BROKER_PORT = 1883
#JWT config
JWT_SECRET_KEY = 'you-will-never-guess'