作者文章归档:陈海峰

[ websocket安装模块错误 ]


配置bing-chat项目时

Bing-Chat项目GITHUB

1. 克隆到本地 git clone xxx

2. 使用Dockerfile文件生成Python镜像文件

# 改良版(未测试)
FROM python:3
ENV PYTHONUNBUFFERED 1
WORKDIR /usr/src/app

RUN apt-get install default-libmysqlclient-dev -y && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

COPY requirements.tx

< Read more >

[ pip下载速度慢 ]


python包管理器pip下载速度慢

清华 终端输入下面两行配置:

RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple && \
  pip config set install.trusted-host mirrors.aliyun.com

阿里

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
pip config set install.trusted-host mirrors.a

< Read more >

[ tiptap快捷键 ]


快捷键(需要先注册才能使用)

基本功能 复制粘贴撤回

Command Windows/Linux macOS
Bold Control B Cmd B
Italicize Control I Cmd I
Underline Control U Cmd U
Strikethrough Control Shift X Cmd Shift X
Highlight Control Shift H Cmd Shift H
Code Control E Cmd E

代码块等..

Apply normal text style Control Alt 0 Cmd

< Read more >

[ Flask数据库增删改查 ]


一.数据库查询

pip install flask-sqlalchemy
pip install mysqlclient

1. 主要文件结构

extention.py

  • 实例化sqlalchemy连接数据库模块
  • 和迁移模块
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate

db: SQLAlchemy = SQLAlchemy()
migrate = Migrate()

models.py

  • 多对多关系梳理:
    • 中间表名db.Table
    • 字段id, 表1外键, 表2外键

用户表

< Read more >

[ vue3请求axios使用 ]


Axios基本在Vue3使用

1. 安装

npm install axios

2. 注册

main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router.js'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import axios from 'axios'
import './assets/ma

< Read more >