· 8 years ago · Jan 04, 2018, 09:58 AM
1# -*- coding: utf8 -*-
2import os
3import logging
4from playhouse.pool import PooledPostgresqlExtDatabase
5from my_trio.utils import Struct
6from datetime import date
7
8from pytz import timezone
9
10
11basedir = os.path.abspath(os.path.dirname(__file__))
12
13LOG_TO = "/home/deploy/logs/my_trio"
14TMP_DIR = "/home/deploy/tmp/my_trio"
15
16
17CSRF_ENABLED = True
18SECRET_KEY = 'you-will-never-guess'
19
20GOOGLE_KEY = "6LfB4AkTAAAAAN1AKCBeT0YNme3gLK66WYkuwIb4"
21GOOGLE_SECRET_KEY = "6LfB4AkTAAAAAIs-7bsnz_uBm40c0YdfNuR-eseu"
22
23LOGGER = Struct(
24 level=logging.DEBUG,
25 file="log_{date:%Y-%m-%d}.log".format(date=date.today()),
26 formatter=logging.Formatter("%(asctime)s [%(thread)d:%(threadName)s] "
27 "[%(levelname)s] - %(name)s:%(message)s"),
28 peewee_file="peewee_log_{date:%Y-%m-%d}.log".format(date=date.today()),
29 unlogged_errors_file="unlogged_errors_log_{date:%Y-%m-%d}.log".format(date=date.today())
30)
31
32DB_CONFIG = dict(database="trio_db", user="my_trio",
33 password="my_trioP@ss", host="localhost", port=5433,
34 max_connections=None, stale_timeout=600, register_hstore=False, server_side_cursors=False)
35
36# slow database query threshold (in seconds)
37DATABASE_QUERY_TIMEOUT = 0.5
38
39STATIC_FOLDER = "/static"
40
41# email server
42MAIL_SERVER = "mail.pay-trio.com" # your mailserver
43MAIL_PORT = 587
44MAIL_USE_TLS = True
45MAIL_USE_SSL = False
46MAIL_USERNAME = "team@pay-trio.com"
47MAIL_PASSWORD = "20pwteam15"
48
49# available languages
50LANGUAGES = {
51 'en': 'English',
52 'ru': 'Russian',
53 'uk': 'Ukrainian'
54}
55
56
57BABEL_DEFAULT_LOCALE = 'ru'
58
59# длительноÑть ÑеÑÑии: 20 мин = 1200 Ñек
60PERMANENT_SESSION_LIFETIME = 1200
61
62TRIO_URL = "https://test-main.pay-trio.com"
63TRIO_SECRET = "mytrio_test"
64TIP_URL = "https://test-tip.pay-trio.com/"
65
66RECORDS_PER_PAGE = 100
67
68PM_IMAGES_PATH = '/home/deploy/tip/pm_images/'
69
70ACCOUNT_SHOPS_LIMIT = 20
71
72BABEL_TRANSLATIONS_PATH = '/home/deploy/my_trio/translations'
73TRIO_REQUESTS_LIMIT = 20
74
75USE_SERVER_SIDE_SESSION = False
76SESSION_TYPE = 'peewee'
77SESSION_PEEWEE_TABLE = 'session_mytrio'
78SESSION_DB_CLASS = PooledPostgresqlExtDatabase
79
80SESSION_KEY_PREFIX = ""
81SESSION_PERMANENT = False
82SESSION_COOKIE_NAME = "server_session_mytrio"
83SESSION_PEEWEE_CONFIG = DB_CONFIG
84
85SUPPORT_EMAIL = "support@pay-trio.com"
86
87SERVER_TIMEZONE = timezone("Europe/Kiev")