-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathconfig.example
executable file
·106 lines (91 loc) · 2.72 KB
/
config.example
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
#!/usr/bin/env python
# -*- coding=UTF-8 -*-
# **************************************************************************
# Copyright © 2016-2019 jianglin
# File Name: config.example
# Author: jianglin
# Email: [email protected]
# Created: 2016-05-20 12:31:46 (CST)
# Last Update: Monday 2022-12-12 16:40:46 (CST)
# By: jianglin
# Description:
# **************************************************************************
from datetime import timedelta
from os import path
PATH = path.abspath(path.dirname(__file__))
DEBUG = True
SECRET_KEY = 'secret key'
SECURITY_PASSWORD_SALT = 'you will never guess'
SECRET_KEY_SALT = 'you will never guess'
# avatar upload directory
AVATAR_FOLDER = path.join(PATH, 'avatars')
# avatar generate range
AVATAR_RANGE = [122, 512]
# for development use localhost:5000
# for production use xxx.com
# SERVER_NAME = 'localhost:5000'
# remember me to save cookies
PERMANENT_SESSION_LIFETIME = timedelta(days=3)
REMEMBER_COOKIE_DURATION = timedelta(days=3)
ONLINE_LAST_MINUTES = 5
# You want show how many topics per page
PER_PAGE = 12
# Use cache
CACHE_TYPE = 'null'
CACHE_DEFAULT_TIMEOUT = 60
CACHE_KEY_PREFIX = 'cache:'
CACHE_REDIS_HOST = '127.0.0.1'
CACHE_REDIS_PORT = '6379'
CACHE_REDIS_PASSWORD = 'your password'
CACHE_REDIS_DB = 2
# Redis setting
REDIS = {
'host': 'redis',
'db': 1,
'password': 'your password',
'decode_responses': True
}
# some middleware
MIDDLEWARE = [
'forums.common.middleware.GlobalMiddleware',
'forums.common.middleware.OnlineMiddleware'
]
# Mail such as qq
MAIL_SERVER = 'smtp.qq.com'
MAIL_PORT = 25
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = "your email"
MAIL_PASSWORD = "your password"
MAIL_DEFAULT_SENDER = 'your email'
# MAIL_SUPPRESS_SEND = True
SERVER_NAME = 'localhost:8000'
SUBDOMAIN = {'forums': True, 'docs': True}
# logging setting
LOGGING = {
'info': 'logs/info.log',
'error': 'logs/error.log',
'send_mail': False,
'toaddrs': [],
'subject': 'Your Application Failed',
'formatter': '''
Message type: %(levelname)s
Location: %(pathname)s:%(lineno)d
Module: %(module)s
Function: %(funcName)s
Time: %(asctime)s
Message:
%(message)s
'''
}
# Sql
SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:password@localhost/your_db'
# SQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'
MSEARCH_INDEX_NAME = 'msearch'
MSEARCH_BACKEND = 'whoosh'
# SQLALCHEMY_ECHO = True
# SQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'
# SQLALCHEMY_DATABASE_URI = 'mysql://username:password@server/db'
BABEL_DEFAULT_LOCALE = 'en'
BABEL_DEFAULT_TIMEZONE = 'UTC'
BABEL_TRANSLATION_DIRECTORIES = path.join(PATH, 'translations')