# SweetSpacePy **Repository Path**: uodrad/sweet-space-py ## Basic Information - **Project Name**: SweetSpacePy - **Description**: 甜蜜空间Python后端 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-06-06 - **Last Updated**: 2024-08-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SweetSpace(甜蜜空间) 基于 **Flask + SQLAlchemy** 的甜蜜空间后端 ## 配置 在该项目目录下新建 `config.yaml` ,配置参考: ```yaml # 服务器配置 ServerConfig: host: 0.0.0.0 # 主机 port: 6868 # 端口 workers: 1 # 进程数 token_expire: 604800 # 会话有效期(秒),用户登录有效期 email_verification_code_expire: 300 # 邮箱验证码有效期(秒) file_max_size: 3145728 # 文件最大上传大小(字节) # 图片上传配置(使用其中一个) ImageUploadConfig: # 图床配置(imgtp图床,图床地址:https://www.imgtp.com/) ImageBed: use: false # 是否使用图床 email: '2493919891@qq.com' # 登录邮箱 password: 'bmw-m3gtr' # 登录密码 # 又拍云云存储 Upyun: use: true # 是否使用云存储 domain: 'uodrad-image.test.upcdn.net' # 加速域名 service: 'uodrad-image' # 服务名称 username: 'clf1010110' # 操作员 password: '4GauEfcXytMZ1YxSHVxtwxPiVKbiHupL' # 操作员密码 # 数据库配置 DatabaseConfig: # Mysql配置 MysqlConfig: host: 127.0.0.1 # 主机 port: 3306 # 端口 database_name: sweet_space # 数据库名称 username: root # 用户名 password: root # 密码 # Sqlalchemy配置 SqlalchemyConfig: on_echo: true # 是否开启查询日志 # Redis配置 RedisConfig: host: 127.0.0.1 # 主机 port: 6379 # 端口 password: '' # 密码 db: 6 # 数据库 # Sweet配置,包括双人信息和起始日期 SweetConfig: # 用户一信息 UserOneInfo: username: one # 用户名 password: '123456' # 密码 nickname: xx先生 # 昵称 email: admin@qq.com # 邮箱 birthday: 1699969710 # 生日(时间戳),可到 https://tool.lu/timestamp/ 转换,注意是以秒为单位 # 用户二信息 UserTwoInfo: username: two # 用户名 password: '123456' # 密码 nickname: xx女士 # 昵称 email: test@qq.com # 邮箱 birthday: 1699969710 # 生日(时间戳),可到 https://tool.lu/timestamp/ 转换,注意是以秒为单位 # 甜蜜起始日期 SweetStartDate: 1699969710 # 起始日期(时间戳),可到 https://tool.lu/timestamp/ 转换,注意是以秒为单位 ``` ## 依赖 - `Python >= 3.8` - `pip install -r requirements.txt` ## 运行 - `python main.py` - 访问地址 `http://localhost:6868`