Exemple #1
0
from slim import Application, CORSOptions, ALL_PERMISSION, EMPTY_PERMISSION, ApplicationDocInfo
import config

app = Application(log_level=config.DEBUG_LEVEL,
                  cookies_secret=config.COOKIE_SECRET,
                  permission=EMPTY_PERMISSION,
                  doc_enable=config.DOC_ENABLE,
                  doc_info=ApplicationDocInfo(title=config.PROJECT_NAME,
                                              description=config.DESC,
                                              version=config.VERSION),
                  cors_options=CORSOptions('*',
                                           allow_credentials=True,
                                           expose_headers="*",
                                           allow_headers="*"))
Exemple #2
0
##########################################
# 必填部分
##########################################

SITE_NAME = 'Icarus'  # 站点名称
SITE_LOGO_TEXT = 'Icarus'  # 左上LOGO文本
SITE_TITLE_TEXT = 'Icarus'  # 站点标题后缀文本
SITE_URL = 'http://*****:*****@mail.com'  # 必填,管理员联系邮箱,用于用户回报站点错误

HOST = '127.0.0.1'
PORT = 9999
DEBUG_LEVEL = logging.INFO
CORS_OPTIONS = CORSOptions('*',
                           allow_credentials=True,
                           expose_headers='*',
                           allow_headers='*')

DATABASE_URI = 'postgresql://postgres@localhost/icarus'  # 必填
REDIS_URI = 'redis://localhost:6379'

# 密码将先在前端哈希后,在后端再次哈希与储存值比对,这是前端哈希用到的盐
USER_SECURE_AUTH_FRONTEND_SALT = b'6I6r5oSB5YmN6Lev5peg55+l5bex77yM5aSp5LiL6LCB5Lq65LiN6K+G5ZCb'  # 前端盐,务必修改默认值

# 页脚附加信息,例如可写入网站备案内容
FOOTER_EXTRA_HTML = ''

# 关于页面
ABOUT_PAGE_ENABLE = True
ABOUT_CUSTOM_HTML = ''