-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
48 lines (48 loc) · 2.15 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
41
42
43
44
45
46
47
48
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
# Version
VERSION = '0.1.5'
API_VERSION = '1.0'
# Secret key
SECRET_KEY = os.environ.get('SECRET_KEY') or 'indovina-indovinello'
WTF_CSRF_TIME_LIMIT = None
# Database
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'dequa.db')
SQLALCHEMY_BINDS = {
"trackusage": 'sqlite:///' + os.path.join(basedir, 'trackusage.db'),
"users": 'sqlite:///' + os.path.join(basedir, 'users.db'),
"errors": 'sqlite:///' + os.path.join(basedir, 'errorMsg.db'),
"ideas": 'sqlite:///' + os.path.join(basedir, 'ideas.db'),
"feed_err": 'sqlite:///' + os.path.join(basedir, 'feed_err.db')
}
SQLALCHEMY_TRACK_MODIFICATIONS = False
# TrackUsage
TRACK_USAGE_USE_FREEGEOIP = False
TRACK_USAGE_INCLUDE_OR_EXCLUDE_VIEWS = 'include'
TRACK_USAGE_COOKIE = False
# Flask-Security
SECURITY_PASSWORD_HASH = 'pbkdf2_sha512'
SECURITY_PASSWORD_SALT = os.environ.get('SECURITY_PASSWORD_SALT') or 'indovina-indovinello'
SECURITY_POST_LOGIN_VIEW = '/admin/'
SECURITY_POST_LOGOUT_VIEW = '/admin/'
SECURITY_POST_REGISTER_VIEW = '/admin/'
SECURITY_REGISTERABLE = False
SECURITY_SEND_REGISTER_EMAIL = False
# Mail
MAIL_SERVER = os.environ.get('MAIL_SERVER') #"smtps.aruba.it"
MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25) #587
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None #1
MAIL_USERNAME = os.environ.get('MAIL_USERNAME') #"[email protected]"
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD') # QUA INSERIRE LA PASSWORD DELL'ACCOUNT
MAIL_DEFAULT_SENDER = os.environ.get('MAIL_DEFAULT_SENDER') #"[email protected]"
ADMINS = ['[email protected]']
# Sitemap
# SITEMAP_URL_SCHEME = 'HTTPS'
# SITEMAP_INCLUDE_RULES_WITHOUT_PARAMS = False # se True, lista tutte (anche admin ecc) le pagine sulla sitemap
# Token
JWT_SECRET_KEY = SECRET_KEY = os.environ.get('JWT_SECRET_KEY') or 'indovina-indovinello'
JWT_BLACKLIST_ENABLED = True
JWT_BLACKLIST_TOKEN_CHECKS = ['access', 'refresh']
PROPAGATE_EXCEPTIONS = True