摘要: Django S3存储之腾讯云-对象存储 (env) D:\env\mysite>pip install boto3 (env) D:\env\mysite>pip install django-storages https://simpleisbetterthancomplex.com/tutor 阅读全文
posted @ 2023-07-07 11:06 花生与酒 阅读(14) 评论(0) 推荐(0) 编辑
摘要: https://www.5axxw.com/wiki/content/28uwws http://www.duoduokou.com/django/22100261690008133083.html class BlogPostStateChoices(models.TextChoices): DR 阅读全文
posted @ 2023-07-06 16:54 花生与酒 阅读(33) 评论(0) 推荐(0) 编辑
摘要: https://www.treejs.cn/v3/main.php#_zTreeInfo 官方文档,demo和api https://www.cnblogs.com/fonour/p/zTree.html https://www.cnblogs.com/longlyseul/p/12111143.h 阅读全文
posted @ 2023-07-06 14:41 花生与酒 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Dict中增加key:value 如 var data={a:1} ,添加 { b:2 } 方法一 ,直接赋值 data.b=2 方法二 data["c"] = 3 List中增加dict function addServerUrlToJson() { var json_tem = [{"name" 阅读全文
posted @ 2023-07-06 10:17 花生与酒 阅读(243) 评论(0) 推荐(0) 编辑
摘要: https://eadwincode.github.io/django-ninja-jwt/ https://pypi.org/project/django-ninja-jwt/ 中文博客简明教程:https://blog.csdn.net/qq_43373298/article/details/1 阅读全文
posted @ 2023-07-03 10:20 花生与酒 阅读(1235) 评论(0) 推荐(0) 编辑
摘要: 在js中,redirect ,有好多方法,可以使用django-js-routes/这个库 https://pypi.org/project/django-js-routes/ 也可以直接在js中写:window.location.href = "{% url'app:result' %}" htt 阅读全文
posted @ 2023-07-02 18:04 花生与酒 阅读(26) 评论(0) 推荐(0) 编辑
摘要: (1)ninja api安全认证,看官网手册最方便 https://django-ninja.rest-framework.com/guides/authentication/ (2)通过ninja 请求token(Ninja JWT provides a JSON Web Token authen 阅读全文
posted @ 2023-07-02 14:53 花生与酒 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 摘抄:https://www.cnblogs.com/fnng/p/16084825.html 学习ninja https://blog.csdn.net/qq_43373298/article/details/121384656 django优点 通过脚手架创建项目/应用:不用考虑项目架构怎么设计 阅读全文
posted @ 2023-07-01 20:31 花生与酒 阅读(1273) 评论(1) 推荐(1) 编辑
摘要: https://django-smart-selects.readthedocs.io/en/latest/usage.html 特点: 简单,不容易定制,适合简单的关联下拉,只能是table-table 有单选、多选、guoup分组等3种组合 from django.db import model 阅读全文
posted @ 2023-07-01 19:13 花生与酒 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 单位的考核系统,采用ssl证书,专门做了总结 又看到一篇文章 https://www.designmycodes.com/python/setup-ssl-certificate-on-nginx-for-django-application.html 可以参考借鉴吧,有时间再读 Serving a 阅读全文
posted @ 2023-06-29 15:26 花生与酒 阅读(24) 评论(0) 推荐(0) 编辑
摘要: django页面导入导出 导出的业务比较通用,广泛,需要开发效率,可以使用 django_import_export 导入,业务不常用,但需要定制化,错误消息要详细,用django_import_export导入,一般用在后台或开发人员自己转移数据。 但提供给前台用户, 还需要选择可定制的,我选择d 阅读全文
posted @ 2023-06-29 10:16 花生与酒 阅读(484) 评论(0) 推荐(0) 编辑
摘要: django.template.exceptions.TemplateDoesNotExist: bootstrap4/uni_form.html django.template.exceptions.TemplateDoesNotExist: bootstrap4/field.html 问题:在使 阅读全文
posted @ 2023-06-27 15:09 花生与酒 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 软件下载地址均为其官网。 一.wget升级 yum install -y wget 二.sqlite3安装 sudo yum install sqlite-devel 查看sqlite3的版本 sqlite3 -version 三.sqlite3升级 下载源码 wget https://www.sq 阅读全文
posted @ 2023-06-26 09:27 花生与酒 阅读(101) 评论(0) 推荐(0) 编辑
摘要: <s-template> <div id="app"> <table> <thead> <tr> <th>Name</th> <th>Age</th> <th>Sex</th> </tr> </thead> <tbody> <tr v-for="person in peoples"> <td>{{ 阅读全文
posted @ 2023-06-20 16:01 花生与酒 阅读(7) 评论(0) 推荐(0) 编辑
摘要: Dealing with user input is a very common task in any Web application or Web site. The standard way to do it is through HTML forms, where the user inpu 阅读全文
posted @ 2023-06-15 10:38 花生与酒 阅读(64) 评论(0) 推荐(0) 编辑
摘要: list和''.join ¶ l = [] for i in range(10000): l.append(str(i)) s = ''.join(l) 推导式法 s = ''.join(str(i) for i in range(10000)) 阅读全文
posted @ 2023-06-15 09:52 花生与酒 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 参考: https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#json-script afely outputs a Python object as JSON, wrapped in a <script> tag, ready 阅读全文
posted @ 2023-06-09 16:22 花生与酒 阅读(40) 评论(0) 推荐(0) 编辑
摘要: E:\sqlite3>sqlite3 db_stu.sqlite3 "VACUUM;" E:\sqlite3>dir 驱动器 E 中的卷没有标签。 卷的序列号是 0672-3CDA E:\sqlite3 的目录 2023/05/16 17:33 <DIR> . 2023/05/16 17:33 <D 阅读全文
posted @ 2023-05-17 11:46 花生与酒 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 安全漏洞CVE-2021-3156, 受影响的 Sudo 版本: Sudo 版本 1.7.7 到 1.7.10p9、1.8.2 到 1.8.31p2 和 1.9.0 到 1.9.5p1 受到影响。 sudo官网:https://www.sudo.ws/ sudo下载地址:https://www.su 阅读全文
posted @ 2023-04-21 11:20 花生与酒 阅读(511) 评论(0) 推荐(0) 编辑
摘要: using Oracle.ManagedDataAccess.Client; namespace ConsoleApp { class Program { static void Main(string[] args) { string connString = "Data Source=xyz; 阅读全文
posted @ 2023-04-11 17:37 花生与酒 阅读(603) 评论(0) 推荐(0) 编辑
摘要: IFNULL() 函数用于判断第一个表达式是否为 NULL,如果为 NULL 则返回第二个参数的值,如果不为 NULL 则返回第一个参数的值。 SELECT IFNULL(NULL, "RUNOOB"); 以上实例输出结果为:RUNOOB SELECT CHAR_LENGTH('我爱祖国'); /* 阅读全文
posted @ 2023-03-03 16:47 花生与酒 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 一、拆脚踏:二边都是往后拧是松,往前是紧二、拆牙盘:先拆左后拆右。1. 先拧6角,6角牙盘侧往后拧.2上拉马,拉马头拧入,宁紧不脱落,然后拧尾部,顶出牙盘。内六角和接码,都是顺时针紧,逆时针松。三、拆中轴:牙盘弄掉后,拆中轴。牙盘和脚踏相反,二边往前是松,往后是紧。不论汉特3还是atx890 四、手 阅读全文
posted @ 2022-08-23 16:02 花生与酒 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 在自己的开发机安装python3.9 参考:https://www.jb51.net/article/202175.htm 1、安装编译依赖项 1 sudo apt install -y wget build-essential libreadline-dev libncursesw5-dev li 阅读全文
posted @ 2022-08-01 17:15 花生与酒 阅读(554) 评论(0) 推荐(0) 编辑
摘要: virtualenv:Python虚拟环境管理工具。 是第三方package,Python3.3之前使用 venv:Python标准库内置的虚拟环境管理工具,是一个module。 Python 3.3加入,用法类似virtualenv,唯一不同的是创建虚拟环境的方式。pyton3.3之后有了venv 阅读全文
posted @ 2022-07-29 15:56 花生与酒 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 1. case, count sql (mysql) SELECT (case when shi='1101' then 1 when shi='2101' then 2 when shi='3101' then 3 when shi='3206' then 4 when shi='5101' th 阅读全文
posted @ 2021-12-29 15:53 花生与酒 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 引用:https://www.cnblogs.com/zjaiccn/p/14338994.html 文章目录 1.Django是什么 2.创建Django项目 3.模板初探 4.ORM的引出 5.ORM语句总结 6.Django Admin (组件) 7.定制Django admin 8.view 阅读全文
posted @ 2021-12-24 23:01 花生与酒 阅读(34) 评论(0) 推荐(0) 编辑
摘要: bootstrap5位置总结 1.text 位置控制 .text-left Align your text content to the left position using this class. .text-right Right align the text content position 阅读全文
posted @ 2021-11-25 15:57 花生与酒 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Django Quick Setup Script Make sure you have a running python setup. Also, pip should be properly installed and configured. You can now run the script 阅读全文
posted @ 2021-11-23 14:56 花生与酒 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 有时候由于添加字段顺序不对,需要对table重建 1. 物理delete table 2.删除model上这个表 3. python manage.py makemigrations rowtable 执行makemigration - Delete model ParentSurvey 4.假装删 阅读全文
posted @ 2021-08-19 12:29 花生与酒 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 一、dict存入model instance data_dict是{}字典数值 # create instance of model m = MyModel(**data_dict) # don't forget to save to database! m.save()# create insta 阅读全文
posted @ 2021-07-23 12:07 花生与酒 阅读(369) 评论(0) 推荐(0) 编辑
摘要: CentOS7下部署Django项目详细操作步骤 2018年07月09日 点击次数:58482 部署是基于:centos7+nginx+uwsgi+python3+django 之上做的 软件版本详细介绍,纯净操作系统:Centos7.0 Python版本:python3.6 Django版本:dj 阅读全文
posted @ 2021-07-18 15:22 花生与酒 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1、创建用户 sftpuser,并禁止ssh登录,不创建家目录 useradd -s /sbin/nologin -M sftpuser 2、设置用户密码 passwd sftpuser --密码:自己定义 3、创建sftp根目录,所有sftp用户都将在该目录下活动 mkdir /home/sftp 阅读全文
posted @ 2021-07-02 10:19 花生与酒 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 前提要开通访问策略和1521端口 import schedule import time import datetime import csv import shutil from django.core.management.base import BaseCommand, CommandErro 阅读全文
posted @ 2021-06-30 17:08 花生与酒 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 如果在线安装, pip install django-axes,很容易 但在内网环境,没那么容易, 根据以前的经验, 下载tar.gz 安装 参考我前一篇:https://www.cnblogs.com/lxgbky/p/12932104.html 但这次,用上面方法不行,因为axes这个包,还有关 阅读全文
posted @ 2021-06-30 16:51 花生与酒 阅读(527) 评论(0) 推荐(0) 编辑
摘要: Nginx的启动、停止与重启 启动 启动代码格式:nginx安装目录地址 -c nginx配置文件地址 例如: [root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 停止 ng 阅读全文
posted @ 2021-04-07 16:58 花生与酒 阅读(5591) 评论(0) 推荐(0) 编辑
摘要: 安装安全狗失败, 经过芮同事的仔细观察,wget安全狗时候,路由到了202.205.180.211.., 当然下载不了安全狗(IP:172.17.22.11)了 如图: 按他的思路,查了一下啊 [root@localhost ]# export declare -x CVS_RSH="ssh" de 阅读全文
posted @ 2021-04-07 12:35 花生与酒 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 先备注一个不相干的指令: 变更用户密码: python manage.py changepassword username 一、 安装package pip install django-cryptography二、创建model from django.db import models from 阅读全文
posted @ 2021-04-01 15:46 花生与酒 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 以前是 asinnux4.5 内核2.6 现在的内核是3.10 ,相当于centos 7.x吧 su 到 root 看看内核,并且安装docker 结果显示 404,其实就是资源链接找不到了 参考:https://blog.csdn.net/hereiskxm/article/details/108 阅读全文
posted @ 2021-02-27 21:11 花生与酒 阅读(96) 评论(0) 推荐(0) 编辑
摘要: https://docs.djangoproject.com/en/dev/ref/models/expressions/ from django.db.models import Count, F, Value from django.db.models.functions import Leng 阅读全文
posted @ 2020-10-16 13:35 花生与酒 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 利用django-axes 控制用户尝试登陆次数,失败若干次后封锁IP禁止登陆 1.install pip install django-axes # バージョンを指定する場合は以下 pip install django-axes==5.0.13 settings.py添加 INSTALLED_AP 阅读全文
posted @ 2020-10-16 11:47 花生与酒 阅读(131) 评论(0) 推荐(0) 编辑