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

相关推荐
孟健6 小时前
Karpathy 用 200 行纯 Python 从零实现 GPT:代码逐行解析
python
码路飞8 小时前
写了个 AI 聊天页面,被 5 种流式格式折腾了一整天 😭
javascript·python
曲幽10 小时前
FastAPI压力测试实战:Locust模拟真实用户并发及优化建议
python·fastapi·web·locust·asyncio·test·uvicorn·workers
敏编程15 小时前
一天一个Python库:jsonschema - JSON 数据验证利器
python
前端付豪15 小时前
LangChain记忆:通过Memory记住上次的对话细节
人工智能·python·langchain
databook15 小时前
ManimCE v0.20.1 发布:LaTeX 渲染修复与动画稳定性提升
python·动效
花酒锄作田1 天前
使用 pkgutil 实现动态插件系统
python
前端付豪1 天前
LangChain链 写一篇完美推文?用SequencialChain链接不同的组件
人工智能·python·langchain
曲幽1 天前
FastAPI实战:打造本地文生图接口,ollama+diffusers让AI绘画更听话
python·fastapi·web·cors·diffusers·lcm·ollama·dreamshaper8·txt2img
老赵全栈实战1 天前
Pydantic配置管理最佳实践(一)
python