SenWeaver SenWeaver
首页
  • 介绍
  • 快速开始
  • 目录结构
  • 模块开发

    • 概述
    • 配置
    • 编码
  • 数据库

    • 概述
    • 查询数据
    • 添加数据
    • 更新数据
    • 删除数据
  • 其他

    • 常见问题
在线演示 (opens new window)
赞助
关于
Gitee (opens new window)
Github (opens new window)
首页
  • 介绍
  • 快速开始
  • 目录结构
  • 模块开发

    • 概述
    • 配置
    • 编码
  • 数据库

    • 概述
    • 查询数据
    • 添加数据
    • 更新数据
    • 删除数据
  • 其他

    • 常见问题
在线演示 (opens new window)
赞助
关于
Gitee (opens new window)
Github (opens new window)
  • 指南

    • 介绍
    • 快速开始
      • 环境依赖
      • 拉取仓库代码
      • 安装环境
      • 创建数据库表
      • 创建超管用户
      • 初始化数据
      • 启动后端
    • 目录结构
  • 模块开发

    • 概述
    • 配置
    • 编码
  • 数据库

    • 概述
    • 查询数据
    • 添加数据
    • 更新数据
    • 删除数据
  • 其他

    • 常见问题
目录

快速开始

注意⚠️

建议使用 Conda 安装 Python,推荐使用Python3.12

# 环境依赖

Python、Redis、(MySQL、PostgreSQL、MariaDB、SQLite、Oracle、SQLServer等SQLAlchemy支持的数据库)

python >=3.12
redis >=6
mariadb > 10.5 | mysql > 8.0 | postgresql 16
1
2
3

# 拉取仓库代码

    # clone the project
    git clone https://gitee.com/senweaver/SenWeaver.git
    
    # enter the project directory
    cd SenWeaver/backend
    
    
    1
    2
    3
    4
    5
    6

    仓库地址: https://gitee.com/senweaver/SenWeaver (opens new window)

    # clone the project
    git clone https://github.com/senweaver/SenWeaver.git
    
    # enter the project directory
    cd SenWeaver/backend
    
    
    1
    2
    3
    4
    5
    6

    仓库地址: https://github.com/senweaver/SenWeaver (opens new window)

    // Make sure to add code blocks to your code group

    # 安装环境

    1. Python环境安装
    conda create -n senweaver python=3.12
    conda activate senweaver
    
    1
    2
    1. 安装依赖包
    pip install poetry --index-url=https://mirrors.aliyun.com/pypi/simple
    poetry install
    
    1
    2
    1. 配置环境变量

    拷贝.env.example为.env,并修改该文件对应的数据库和密钥等信息

    #Linux 或 macOS 系统
    cp .env.example .env
    #windows系统
    copy .env.example .env
    
    1
    2
    3
    4

    # 创建数据库表

    使用数据库迁移 alembic (opens new window)

    1. 生成迁移文件

      alembic revision --autogenerate
      
      1
    2. 执行迁移

      alembic upgrade head
      
      1

    # 创建超管用户

    python main.py createsuperuser
    
    1

    # 初始化数据

    python main.py data init
    
    1

    # 启动后端

    python main.py run
    
    1
    上次更新: 2025/02/28, 10:58:46
    介绍
    目录结构

    ← 介绍 目录结构→

    最近更新
    更多文章>
    Theme by Vdoing | Copyright © 2025-2025 SenWeaver | MIT License | 桂ICP备16009365号-9 | 桂公网安备45031202000442号