PYTHON全栈工程师学习路程

目标:
从构建PC端页面功能,系统,到小程序、APP端构建生成。

1、
黑马Python6.5就业班学习-基础-高级-miniweb应用
主要PPT和命令,最好敲代码
工具:
https://www.python.org/
down:
https://www.python.org/downloads/source/
或简单点下这个:
Anaconda3
https://www.anaconda.com/
pycharm激活版本
https://www.ghxi.com/pycharm.html

2、Django+vue全栈管理系统
VUE前端官网:
https://cn.vuejs.org/

https://www.django-vue-admin.com/
环境跑起来,前后端分离,前段模块js
学习文档
https://www.django-vue-admin.com/document/
https://gitee.com/liqianglog/django-vue-admin

最好学习docker,环境配置是个很烦的问题,而且到时上线docker也很方便,后期可熟悉K8S,容器化必会,后期CICD
https://www.runoob.com/docker/docker-compose.html
https://docs.microsoft.com/zh-cn/windows/wsl/install-win10
PowerShell
wsl –list –verbose
wsl –set-default-version 2
wsl –list –online
wsl.exe –update
wsl –install –d Debian
一开始装wsl –install –d Ubuntu-20.04,然后发现docker文件里是Debian,所以更换了
wsl 删除
先输入 wslconfig /l
再输入 wslconfig /u docker-desktop-data #debian替换为你想卸载的名字
win10怎么卸载wsl子系统
https://jingyan.baidu.com/article/a17d52852b37aac199c8f251.html
win10 WSL2问题解决WslRegisterDistribution failed with error: 0x800701bc
https://blog.csdn.net/qq_18625805/article/details/109732122
Win10 WSL2 安装Docker
https://www.jianshu.com/p/a20c2d58eaac
替换下加速配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"registry-mirrors":["https://hub-mirror.c.163.com/",
"https://reg-mirror.qiniu.com",
"https://docker.mirrors.ustc.edu.cn"],
"insecure-registries": [],
"debug": false,
"experimental": false,
"features": {
"buildkit": true
},
"builder": {
"gc": {
"enabled": true,
"defaultKeepStorage": "20GB"
}
}
}

下载源码解压:
https://gitee.com/liqianglog/django-vue-admin
Docker-compose 部署
https://www.django-vue-admin.com/document/hjbs.html#docker-compose-%E9%83%A8%E7%BD%B2-%E6%8E%A8%E8%8D%90
先安装docker-compose (自行百度安装),执行此命令等待安装
docker-compose up

–》运行完毕后关掉再次运行,执行下面的即可
初始化后端数据(第一次执行即可)
docker exec -ti dvadmin-django bash
python3 manage.py init -y
exit
前端地址:http://127.0.0.1:8080
后端地址:http://127.0.0.1:8000
账号:admin 密码:123456

docker exec -ti dvadmin-django bash
apt-get install -y python3.7-dev libpq-dev libopencv-dev python-opencv
apt-get install python3-dev

0、去掉每次django覆盖配置文件操作
django-vue-admin\docker_env\django\Dockerfile
django-vue-admin\docker_env\celery\Dockerfile

1
COPY ./dvadmin-backend/conf/env.example.py /dvadmin-backend/conf/env.py

1、去除登录验证码
django-vue-admin\dvadmin-backend\conf\env.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 只允许访问的ip地址列表
ALLOWED_HOSTS = ['*']
# 允许跨域源
CORS_ORIGIN_ALLOW_ALL = True
# 允许ajax请求携带cookie
CORS_ALLOW_CREDENTIALS = False
# 验证码状态
CAPTCHA_STATE = False
# 操作日志配置
API_LOG_ENABLE = True
API_LOG_METHODS = ['POST', 'DELETE', 'PUT'] # 'ALL' or ['POST', 'DELETE']
# 接口权限
INTERFACE_PERMISSION = False
# 是否开启登录ip转换成城市位置
ENABLE_LOGIN_LOCATION = True

验证码状态
2、去掉每次vue打包-docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

# npm install --registry=https://registry.npm.taobao.org
# rm -rf /dvadmin-ui/dist
# npm run build:prod

version: "3"
services:
dvadmin-ui:
container_name: dvadmin-ui
ports:
- "8080:8080"
build:
context: ./
dockerfile: ./docker_env/vue-ui/Dockerfile
environment:
TZ: Asia/Shanghai
volumes:
- "./dvadmin-ui:/dvadmin-ui"
command:
- /bin/bash
- -c
- |
cd /dvadmin-ui
npm run dev

3、Python报错:OperationalError:(MySQLdb._exceptions.OperationalError) (1366, “Incorrect string value:) uft8m64
https://blog.csdn.net/happy_wealthy/article/details/118157397
utf8mb4_unicode_ci
https://blog.csdn.net/yzh_1346983557/article/details/89643071

4、为啥后台登录会错误
数据导入还需要初始化
django-vue-admin\dvadmin-backend\docker_start.sh
python ./manage.py makemigrations
python ./manage.py migrate

1
python ./manage.py init

linux安装docker-compose
https://github.com/docker/compose
https://www.cnblogs.com/shary-blue/p/14002987.html
https://www.cnblogs.com/pzk7788/p/10180197.html
网络报错:https://theorangeone.net/posts/increase-docker-ip-space/
vi /etc/docker/daemon.json
{
“registry-mirrors”: [
https://hub-mirror.c.163.com/",
https://reg-mirror.qiniu.com",
https://docker.mirrors.ustc.edu.cn"
],
“default-address-pools”:[{“base”:”172.80.0.0/16”,”size”:24},
{“base”:”172.90.0.0/16”,”size”:24}]
}

案例:
Django+Vue+Docker搭建接口测试平台实战
https://www.cnblogs.com/jinjiangongzuoshi/p/14711858.html

利用python,jieba,bm25,django,nginx半小时打造一个基本可用的中文全文检索的搜索引擎
http://blog.54chen.com/post/chinese-search/

其他ps:
python+vue
pip3.9 install –user -r requirements.txt

1
tar -xvf node-v16.8.0-linux-x64.tar.xz -C /usr/local/
1
2
ln -s /usr/local/node-v16.8.0-linux-x64/bin/node /usr/bin/node
ln -s /usr/local/node-v16.8.0-linux-x64/bin/npm /usr/bin/npm

创建虚拟环境
https://docs.python.org/zh-cn/3/tutorial/venv.html


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!