123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- #!/usr/bin/env python
- # -*- coding=UTF-8 -*-
- # **************************************************************************
- # Copyright © 2016-2019 jianglin
- # File Name: config.example
- # Author: jianglin
- # Email: mail@honmaple.com
- # 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')
|