python-Dgango项目收集静态文件、构建前端、安装依赖

数据平台项目(python+django+react)

后端:

查看环境: conda env list

先激活环境: conda activate unlabel

(unlabel) PS D:\unbel_school> python .\label_studio\manage.py runserver 0.0.0.0:28080 加上0.0.0.0:28080 局域网内其他主机可以访问本地项目

启动不起来:执行pip install -e .

要是ImportError: DLL load failed while importing _pydantic_core: 应用程序控制策略已阻止此文件。

执行pip uninstall pydantic pydantic-core -y然后执行 conda install -c conda-forge pydantic

给团队创建者一个重置团队所有人密码的功能,只能重置本团队成员的密码,重置按钮放在api令牌设置按钮旁边。另外在团队管理的成员信息列表操作列加一个重置按钮,重置具体某个成员的密码。。超级管理员可以重置所有人密码,超级管理的重置密码按钮放在单位管理成员列表的操作列

查询linux服务器docker占用资源情况: docker stats

使用硬编码密码作为所有重置密码的新密码

new_password = 'sjbz123456'

2344 2350 2357

前端:

第一种未生效或不好用: 清除缓存:npx nx reset 然后重启项目

"ls:dev": "nx run labelstudio:serve:development",

第二种生效:"ls:build": "nx run labelstudio:build:production",

s:dev": "nx run labelstudio:serve:development",

浏览器清除缓存

团队角色-编辑角色修改角色描述文字

项目 目录:创建新团队空间只能创建进行创建 修改

受邀注册 页面 的注册账号改为 个人注册

pip install -e .

python manage.py migrate

python manage.py makemigrations - 生成新迁移

python manage.py migrate - 执行迁移

跳过代码格式化,直接生成迁移

python manage.py makemigrations --check --dry-run # 检查是否有迁移

python manage.py makemigrations --no-input # 不提示输入,跳过格式化

导出现有依赖

pip freeze > requirements.txt

创建新虚拟环境

python -m venv D:\myproject_env

激活

D:\myproject_env\Scripts\activate

安装依赖

pip install -r requirements.txt

启动第一次运行:

推荐:npm​永久配置:npm config set registry https://registry.npmmirror.com 验证命令: npm get config get registry

在 web 目录下执行

cd D:\label_studio_online_github\web

配置 NPM 使用国内镜像

npm config set registry https://registry.npmmirror.com

npm config set disturl https://npmmirror.com/dist

npm config set sass_binary_site https://npmmirror.com/mirrors/node-sass

使用 npm 安装(通常比 yarn 更稳定)

npm install --legacy-peer-deps

不稳定:yarn​永久配置:yarn config set registry https://registry.npmmirror.com 验证命令: yarn config get registry

yarn config set registry https://registry.npmmirror.com

yarn install 或 npm install

yarn cache clean

yarn install --network-timeout 100000

在D:\soft\anacoda\envs\label_studio_online\执行: python.exe manage.py collectstatic --noinput

1. 构建前端(在 web 目录)

cd D:\label_studio_online_github\web

npm run build

或 yarn build

2. 收集静态文件(在 label_studio 目录)

cd D:\label_studio_online_github\label_studio

python manage.py collectstatic --noinput

相关推荐
默_笙2 天前
🍙 给每个请求过安检:FastAPI 是怎么把校验写进类型注解的
python
小羊没烦恼!3 天前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
qq_426003963 天前
启动playwright录制codegen生成自动化测试脚本
python·自动化
虎头金猫3 天前
4K 视频总卡在公网带宽?用 N1 + OpenList 把网盘播放链路重新理顺
运维·服务器·网络·python·容器·beautifulsoup·pandas
长沙三为智能科技3 天前
家政小程序开发从0到上线:五阶段交付流程与验收清单
python
伞伞悦读3 天前
【第38期】Python 模块与包详解:import、from、模块搜索路径、包结构和 __init__
开发语言·python
只睡四小时3 天前
Canvas 弹道联机实战:700 行 + 固定时间步长
python·websocket·html5·游戏开发·canvas
C语言小火车3 天前
C/C++ 为什么需要编译器?
开发语言·c++
奇思妙想聪明勤奋的小羊3 天前
DeepAgents第5章:子Agent 与上下文隔离—让 Agent学会委派
人工智能·python·学习·语言模型
lpfasd1233 天前
2026年第38周GitHub趋势周报
python·科技·github