摘要: settings.py import time cur_path = os.path.dirname(os.path.realpath(__file__)) # log_path是存放日志的路径 log_path = os.path.join(os.path.dirname(cur_path), ' 阅读全文
posted @ 2020-07-14 17:23 peterWXM 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1在项目根路径下配置Dockerfile文件: # 从仓库拉取 带有 python 3.7 的 Linux 环境 FROM python:3.7 # 设置 python 环境变量 ENV PYTHONUNBUFFERED 1 # 创建 code 文件夹并将其设置为工作目录 RUN mkdir /co 阅读全文
posted @ 2020-07-14 17:08 peterWXM 阅读(192) 评论(0) 推荐(0) 编辑
摘要: # 安装 pipreqs pip3 install pipreqs # 生成依赖文件,其中前面的路径为项目根目录路径 # Windows 一定要在后面加上编码,否则报 UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 阅读全文
posted @ 2020-07-14 15:32 peterWXM 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 1.由于apt官方库里的docker版本可能比较旧,所以先卸载可能存在的旧版本 sudo apt-get remove docker docker-engine docker-ce docker.io 2.更新apt包索引: sudo apt-get update 3.安装以下包以使apt可以通过H 阅读全文
posted @ 2020-07-14 15:24 peterWXM 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 其实v-model的本质就是 v-bind:value和v-on:input的组合使用 <div id="app"> <div>{{msg}}</div> <input type="text" v-bind:value="msg" v-on:input="handle"> </div> <scrip 阅读全文
posted @ 2020-07-02 09:43 peterWXM 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1.创建模型 models.py from django.db import models # Create your models here. class UserInfo(models.Model): id = models.AutoField(primary_key=True) usernam 阅读全文
posted @ 2020-06-15 17:39 peterWXM 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1.order_by select * from products order_by salary desc;(倒叙) select * from products order_by salary asc; 2.利用正则表达式 select * from products where name re 阅读全文
posted @ 2020-05-31 14:06 peterWXM 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1.查询单个字段 select last_name from employees; 2.查询多个字段 select last_name,salary,email from employees; 3.查询所有字段 select * from employees; 4.查询常量值 select 100; 阅读全文
posted @ 2020-05-29 22:06 peterWXM 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Mysql中的数据类型: 字符串型:(注意:char和varchar需要指定长度,例如:char(10)) 类型 字节 大小 说明 char 1 0~255 2^8定长字节 varchar 2 0~65535 2^16定长字节 tinytext 1 0~255 短文本,与char存储形式不同 tex 阅读全文
posted @ 2020-05-28 21:25 peterWXM 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1.在adminx.py文件中添加一下内容: #设置全局的设置类 class GlobalSettings(object): site_title="频道后台管理" site_footer="其它" # menu_style = 'accordion' """ 自定义页面 """ def get_s 阅读全文
posted @ 2020-05-27 17:30 peterWXM 阅读(1127) 评论(0) 推荐(0) 编辑