1 Star 0 Fork 97

finder6218 / fastapi

forked from binkuolo / fastapi 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.py 1.22 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
binkuolo 提交于 2022-06-07 00:49 . wechatpy微信授权登录
# -*- coding:utf-8 -*-
"""
@Created on : 2022/4/22 22:02
@Author: binkuolo
@Des: 基本配置文件
"""
import os
from dotenv import load_dotenv, find_dotenv
from pydantic import BaseSettings
from typing import List
class Config(BaseSettings):
# 加载环境变量
load_dotenv(find_dotenv(), override=True)
# 调试模式
APP_DEBUG: bool = True
# 项目信息
VERSION: str = "0.0.1"
PROJECT_NAME: str = "fasdapi"
DESCRIPTION: str = '<a href="/redoc" target="_blank">redoc</a>'
# 静态资源目录
STATIC_DIR: str = os.path.join(os.getcwd(), "static")
TEMPLATE_DIR: str = os.path.join(STATIC_DIR, "templates")
# 跨域请求
CORS_ORIGINS: List = ["*"]
CORS_ALLOW_CREDENTIALS: bool = True
CORS_ALLOW_METHODS: List = ["*"]
CORS_ALLOW_HEADERS: List = ["*"]
# Session
SECRET_KEY = "session"
SESSION_COOKIE = "session_id"
SESSION_MAX_AGE = 14 * 24 * 60 * 60
# Jwt
JWT_SECRET_KEY = "09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7"
JWT_ALGORITHM = "HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES = 24 * 60
SWAGGER_UI_OAUTH2_REDIRECT_URL = "/api/v1/test/oath2"
# 二维码过期时间
QRCODE_EXPIRE = 60 * 1
settings = Config()
1
https://gitee.com/finder6218/fastapi.git
git@gitee.com:finder6218/fastapi.git
finder6218
fastapi
fastapi
main

搜索帮助