-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
146 lines (126 loc) · 4.68 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# -*- coding: utf-8 -*-
import os, pytz
from datetime import datetime
from datetime import timedelta
# Statement for enabling the development environment
DEBUG = True
#port used to serve this service
PORT = 8080
#SESSION_TYPE = 'redis'
# Define the application directory
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
# Define the database - we are working with
# SQLite for this example
SQLALCHEMY_DATABASE_URI = 'postgresql://triviapatente:triviapatente@localhost:5432/triviapatente'
SQLALCHEMY_TEST_DATABASE_URI = 'postgresql://triviapatente:triviapatente@localhost:5432/triviapatente_test'
LIMIT_MINUTES_TO_BE_CONSIDERED_ONLINE = 5
DDOS_LIMITS = ["3 per second", "30 per minute"]
DDOS_LIMITS_IMAGES = ["12 per second", "120 per minute"]
INSTAGRAM_API_ENDPOINT = "https://api.instagram.com/v1/users/self/media/recent/"
NEEDS_INSTAGRAM_SHOWGALLERY = True
DAY = 24 * 60 * 60
MATCH_MAX_AGE = 3 * DAY #3 days
MATCH_ALERT_AGE = MATCH_MAX_AGE - DAY #2 days
# Application threads. A common general assumption is
# using 2 per available processor cores - to handle
# incoming requests using one and performing background
# operations using the other.
THREADS_PER_PAGE = 1
# Enable protection agains *Cross-site Request Forgery (CSRF)*
CSRF_ENABLED = True
NUMBER_OF_QUESTIONS_FOR_TRAINING = 40
#max age for files
SEND_FILE_MAX_AGE_DEFAULT = 60 * 10 #10 minutes
# Use a secure, unique and absolutely secret key for
# signing the data.
CSRF_SESSION_KEY = "dssovnjaeknbjkrebnwdvlknfvbkndfbl"
# Secret key for signing cookies
SECRET_KEY = "dvkljmdklvmvdkjVSDLjmvlfsnv.kmvsdvsdlvn"
SSL_CERT_PATH = "/etc/ssl/tp_certs/www.triviapatente.it_ssl_certificate.cer"
SSL_CERT_CHAIN_PATH = "/etc/ssl/tp_certs/triviapatente.it_ssl_certificate_INTERMEDIATE.cer"
SSL_PRIVATE_KEY_PATH = "/etc/ssl/tp_certs/www.triviapatente.it_private_key.key"
PUBLIC_INFOS = {
"name": "TriviaPatente Webservice",
"version": 0.9,
"webservice type": "REST",
"last_run": datetime.now(pytz.utc)
}
#mail config
#NOTE: temporaneo, quando compriamo il dominio è da cambiare
EMAIL_SENDER = "support@triviapatente.it"
MAIL_SERVER = "smtp.1and1.it"
MAIL_PORT = 587
#MAIL_USE_SSL = True
MAIL_USE_TLS = True
#MAIL_DEBUG : default app.debug
MAIL_USERNAME = "support@triviapatente.it"
MAIL_PASSWORD = "ne4-JUN-aD2-sE2"
INIT_DB = False
TRAP_BAD_REQUEST_ERRORS = DEBUG
DEFAULT_USER_SCORE = 100
SQLALCHEMY_TRACK_MODIFICATIONS = False
MAX_FEEDBACK_CHARS_FOR_FIELD = 1000
MAX_CHARS_FOR_FIELD = 300
#vite iniziali per utente
INITIAL_LIFES = 3
#numero minimo di caratteri username
USERNAME_MIN_CHARS = 3
#numero minimo di caratteri password
PASSWORD_MIN_CHARS = 7
#estensioni ammesse
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])
#numero di categorie proposte per il gioco
NUMBER_OF_CATEGORIES_PROPOSED = 5
#numero di domande per gioco
NUMBER_OF_QUESTIONS_PER_ROUND = 4
#numero di recent games per pagina
RECENT_GAMES_PER_PAGE = 50
#numero di round per partita
NUMBER_OF_ROUNDS = 5
#percorso dove vengono salvate le immagini dei quiz
QUIZ_IMAGE_FOLDER = "images/"
CATEGORY_IMAGE_FOLDER = "images/categories/"
#percorso delle immagini utenti
UPLOAD_FOLDER = "images/users/"
#numero di risultati mostrati nella classifica italiana
RESULTS_LIMIT_RANK_ITALY = 20
#fattore moltiplicativo massimo e minimo
#MAX_MULTIPLIER_FACTOR = 100
#MIN_MULTIPLIER_FACTOR = 32
#bonus di punteggio per partita giocata
#BONUS_SCORE = 10
#incremento di range ogni tentativo
#RANGE_INCREMENT = 50
#range iniziale
#INITIAL_RANGE = 200
#numero di punti assegnati/tolti in caso di uscita dalla partita
SCORE_ON_LEFT_GAME = 5
#terms and conditions url
TERMS_PATH = "static/pdf/TriviaPatente Terms And Conditions.pdf"
#terms and conditions last update
TERMS_AND_CONDITIONS_LAST_UPDATE = datetime(2017, 12, 15, 00, 22) #00:22 of 16/12/2017
#privacy policy url
PRIVACY_POLICY_URL = "https://www.iubenda.com/privacy-policy/8283872"
#gdpr
#revoke
REVOKE_PERMISSIONS_URL = "https://triviapatente.it#gdprrevoke"
#drop
DROP_ACCOUNT_URL = "https://triviapatente.it#gdprdrop"
#get
GET_DATA_URL = "https://triviapatente.it#gdprget"
#privacy policy last update
PRIVACY_POLICY_LAST_UPDATE = datetime(2017, 12, 15, 00, 22) #00:22 of 16/12/2017
#url to android store
ANDROID_STORE_URL = "https://play.google.com/store/apps/details?id=it.triviapatente.android"
#url to iOS store
IOS_STORE_URL = "https://itunes.apple.com/it/app/triviapatente/id1326510033"
#numero di messaggi nuovi mostrati ad ogni scroll
MESSAGE_PER_SCROLL = 50
#numero di divisioni dati nel chart delle statistiche
NUMBER_OF_CHART_DIVISORS = 15
#stringhe json statistiche allenamento
TRAINING_STATS_TOTAL = "total"
TRAINING_STATS_NO_ERRORS = "correct"
TRAINING_STATS_1_2_ERRORS = "1_2errors"
TRAINING_STATS_3_4_ERRORS = "3_4errors"
TRAINING_STATS_MORE_ERRORS = "more_errors"