You've already forked opc-backend
docs: 新增配置文件、后端依赖清单及完整运行部署文档
This commit is contained in:
24
.env
Normal file
24
.env
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Database Configuration
|
||||||
|
DB_ENGINE=django.db.backends.postgresql
|
||||||
|
DB_NAME=blw
|
||||||
|
DB_USER=blw
|
||||||
|
DB_PASSWORD=yingnuo@2077
|
||||||
|
DB_HOST=129.28.68.153
|
||||||
|
DB_PORT=8200
|
||||||
|
|
||||||
|
# Redis Configuration
|
||||||
|
REDIS_CONN=redis://129.28.68.153:8201/0
|
||||||
|
|
||||||
|
# Application Configuration
|
||||||
|
SECRET_KEY=django-insecure-opc-community-platform
|
||||||
|
DEBUG=True
|
||||||
|
ALLOWED_HOSTS=*
|
||||||
|
CORS_ALLOW_ALL_ORIGINS=True
|
||||||
|
|
||||||
|
# MinIO Configuration
|
||||||
|
MINIO_ENDPOINT=129.28.68.153:8202
|
||||||
|
MINIO_ACCESS_KEY=N9O3ZBNOCCC1L690B6J0
|
||||||
|
MINIO_SECRET_KEY=GUxGlc3QjH2Y+CSxI5uy0e2GBWGTQ6W1YXX0aKG9
|
||||||
|
MINIO_BUCKET_NAME=blw
|
||||||
|
MINIO_SECURE=False
|
||||||
|
MINIO_PUBLIC_URL=http://129.28.68.153:8202
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,7 +3,7 @@ __pycache__/
|
|||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
*.pyd
|
*.pyd
|
||||||
.env
|
|
||||||
.pytest_cache/
|
.pytest_cache/
|
||||||
.coverage
|
.coverage
|
||||||
htmlcov/
|
htmlcov/
|
||||||
|
|||||||
37
README.md
Normal file
37
README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# OPC 协同平台 - 后端服务 (opc-backend)
|
||||||
|
|
||||||
|
这是 OPC 协同平台的核心后端微服务。已预先为您配置好了 PostgreSQL 数据库、Redis 以及 MinIO 凭证(见根目录下的 `.env` 文件)。
|
||||||
|
|
||||||
|
## 🚀 快速启动指南
|
||||||
|
|
||||||
|
在任意内网机器上克隆本项目后,您可以按照以下标准步骤直接启动:
|
||||||
|
|
||||||
|
### 1. 准备 Python 虚拟环境
|
||||||
|
为了不污染全局环境,建议先创建并激活虚拟环境:
|
||||||
|
```bash
|
||||||
|
# 创建虚拟环境 (如已包含 venv 可跳过此步骤)
|
||||||
|
python -m venv venv
|
||||||
|
|
||||||
|
# 激活虚拟环境 (mac/linux)
|
||||||
|
source venv/bin/activate
|
||||||
|
# Windows 激活命令为: venv\Scripts\activate
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 安装依赖包
|
||||||
|
```bash
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 3. 同步数据库结构
|
||||||
|
```bash
|
||||||
|
python manage.py makemigrations
|
||||||
|
python manage.py migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. 运行服务
|
||||||
|
```bash
|
||||||
|
python manage.py runserver 0.0.0.0:8000
|
||||||
|
```
|
||||||
|
|
||||||
|
服务启动后,前端可以通过 `http://<服务器IP>:8000/` 与本服务进行交互。
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
开发了多角色登录与鉴权接口:实现了普通用户、企业和管理员的登录分流,并支持Token验证。
|
|
||||||
开发了权限控制接口:实现了通过数据库分配菜单权限节点,控制接口访问安全。
|
|
||||||
开发了实名认证中心:实现了个人身份证信息与企业营业执照的提交与审核接口。
|
|
||||||
开发了任务与协作大厅核心业务:实现了任务的发布、接单、状态流转以及专家邀约接口。
|
|
||||||
配置了全局环境变量与数据库引擎:集成了 PostgreSQL 数据库、Redis 缓存与 MinIO 对象存储。
|
|
||||||
36
requirements.txt
Normal file
36
requirements.txt
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
amqp==5.3.1
|
||||||
|
argon2-cffi==25.1.0
|
||||||
|
argon2-cffi-bindings==25.1.0
|
||||||
|
asgiref==3.11.1
|
||||||
|
async-timeout==5.0.1
|
||||||
|
billiard==4.2.4
|
||||||
|
celery==5.6.3
|
||||||
|
certifi==2026.4.22
|
||||||
|
cffi==2.0.0
|
||||||
|
click==8.1.8
|
||||||
|
click-didyoumean==0.3.1
|
||||||
|
click-plugins==1.1.1.2
|
||||||
|
click-repl==0.3.0
|
||||||
|
Django==4.2.30
|
||||||
|
django-cors-headers==4.9.0
|
||||||
|
djangorestframework==3.16.1
|
||||||
|
djangorestframework_simplejwt==5.5.1
|
||||||
|
exceptiongroup==1.3.1
|
||||||
|
kombu==5.6.2
|
||||||
|
minio==7.2.20
|
||||||
|
packaging==26.2
|
||||||
|
prompt_toolkit==3.0.52
|
||||||
|
psycopg2-binary==2.9.12
|
||||||
|
pycparser==2.23
|
||||||
|
pycryptodome==3.23.0
|
||||||
|
PyJWT==2.12.1
|
||||||
|
python-dateutil==2.9.0.post0
|
||||||
|
redis==7.0.1
|
||||||
|
six==1.17.0
|
||||||
|
sqlparse==0.5.5
|
||||||
|
typing_extensions==4.15.0
|
||||||
|
tzdata==2026.2
|
||||||
|
tzlocal==5.3.1
|
||||||
|
urllib3==2.6.3
|
||||||
|
vine==5.1.0
|
||||||
|
wcwidth==0.6.0
|
||||||
Reference in New Issue
Block a user