快速开始
注意⚠️
建议使用 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
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
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
2
3
4
5
6
仓库地址: https://github.com/senweaver/SenWeaver (opens new window)
// Make sure to add code blocks to your code group
# 安装环境
- Python环境安装
conda create -n senweaver python=3.12
conda activate senweaver
1
2
2
- 安装依赖包
pip install poetry --index-url=https://mirrors.aliyun.com/pypi/simple
poetry install
1
2
2
- 配置环境变量
拷贝.env.example为.env,并修改该文件对应的数据库和密钥等信息
#Linux 或 macOS 系统
cp .env.example .env
#windows系统
copy .env.example .env
1
2
3
4
2
3
4
# 创建数据库表
使用数据库迁移 alembic (opens new window)
生成迁移文件
alembic revision --autogenerate1执行迁移
alembic upgrade head1
# 创建超管用户
python main.py createsuperuser
1
# 初始化数据
python main.py data init
1
# 启动后端
python main.py run
1
上次更新: 2025/02/28, 10:58:46