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

相关推荐
小努蛋4 分钟前
linux编译openresty异常问题,lua_cjson.c:706:5: 错误: ‘for‘ 循环初始化声明只在 C99 或 C++ 模式下允许
开发语言·lua·openresty
qz_Serene18 分钟前
C++:类和对象(上)
开发语言·c++
COOLMO研究AI23 分钟前
Python 如何在 AI 接口中实现请求幂等性:防止重复提交与重复扣费
人工智能·python·php
CTA量化套保34 分钟前
新手学量化,先做能复查的小流程
人工智能·python
西安景驰电子1 小时前
《PTP精确时间协议系列》第一篇:从原理到应用,全面解读IEEE 1588
linux·运维·服务器·开发语言·网络·windows·php
ctlover1 小时前
Python文件操作
开发语言·python
luj_17681 小时前
塔防牌:策略与卡牌的智慧碰撞
服务器·c语言·开发语言·经验分享·算法
AndrewHZ1 小时前
图像处理入门(第005期):颜色空间入门——RGB/HSV/CMYK/Lab
图像处理·python·opencv·hsv·rgb·色彩空间
风流 少年1 小时前
Spring AI 2.0:Tool
java·python·spring
wuyk5551 小时前
3.链表:用指针串联的动态数据结构
c语言·开发语言·数据结构·链表