TelegramAktienBot/api/config.py
H4CK3R-01 ecc532b752 Extracted frontend from webservice to new directory
Updated directory structure
Updated .gitignore
2022-03-17 17:11:00 +01:00

53 lines
1.5 KiB
Python

import os
from dotenv import load_dotenv
from scheme import BaseResponseSchema
load_dotenv()
class ConfigClass(object):
""" Flask application config """
# Flask settings
SECRET_KEY = os.getenv('SECRET_KEY')
# Flask-SQLAlchemy settings
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://" + \
os.getenv('MYSQL_USER') + ":" + \
os.getenv('MYSQL_PASSWORD') + "@" + \
os.getenv('MYSQL_HOST') + ":" + \
(os.getenv("MYSQL_PORT") or str(3306)) + "/" + \
os.getenv('MYSQL_DATABASE')
SQLALCHEMY_TRACK_MODIFICATIONS = False # Avoids SQLAlchemy warning
# openapi/Swagger config
SPEC_FORMAT = 'yaml'
SERVERS = [
{
"name": "Production",
"url": "https://aktienbot.flokaiser.com"
},
{
"name": "Local",
"url": "http://127.0.0.1:5000"
}
]
INFO = {
'description': 'Webengineering 2 | Telegram Aktienbot',
'version': '0.0.1'
# 'termsOfService': 'http://example.com',
# 'contact': {
# 'name': 'API Support',
# 'url': 'http://www.example.com/support',
# 'email': 'support@example.com'
# },
# 'license': {
# 'name': 'Apache 2.0',
# 'url': 'http://www.apache.org/licenses/LICENSE-2.0.html'
# }
}
BASE_RESPONSE_DATA_KEY = "data"
BASE_RESPONSE_SCHEMA = BaseResponseSchema