1 Star 0 Fork 1

toliong/Fasdapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
config.py 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
binkuolo 提交于 2022-04-28 18:25 . fasdapi-rabc权限实现
# -*- coding:utf-8 -*-
"""
@Created on : 2022/4/22 22:02
@Author: binkuolo
@Des: 基本配置文件
"""
import os.path
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 = "fastapi-demo"
DESCRIPTION: str = 'fastapi项目demo'
# 静态资源目录
STATIC_DIR: str = os.path.join(os.getcwd(), "static")
TEMPLATE_DIR: str = os.path.join(STATIC_DIR, "templates")
# 跨域请求
CORS_ORIGINS: List[str] = ['*']
CORS_ALLOW_CREDENTIALS: bool = True
CORS_ALLOW_METHODS: List[str] = ['*']
CORS_ALLOW_HEADERS: List[str] = ['*']
# 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
settings = Config()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/toliong/fasdapi.git
git@gitee.com:toliong/fasdapi.git
toliong
fasdapi
Fasdapi
master

搜索帮助