随笔分类 - 问题解决
摘要:dic = {'a': 2, 'ab': 2, 'abc': 2, 'abca': 1, 'abcab': 1, 'abcabc': 1, 'abcabcb': 1, 'abcabcbb': 1}res = max(dic, key=lambda x: dic[x])print('打印:'+res)
阅读全文
摘要:当你执行 python manage.py migrate 时,提示 django.db.utils.InternalError: (1366, "Incorrect string value: '\\xxx\\xxx\\xxx\\xxx\\xxx\\xxx' for column 'name' a
阅读全文
摘要:1.添加 ALTER TABLE 表名 ADD 字段名 字段类型(字段长度) DEFAULT 默认值 COMMENT '注释' 例如:ALTER TABLE order ADD code CHAR(12) DEFAULT NULL COMMENT '这里是注释' 2.修改 ①修改字段名 ALTER
阅读全文
摘要:1.cd到/etc/init.d 创建一个uwsgi文件,修改权限 chmod 775 uwsgi 2.编辑该文件 #!/bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $local_fs $remote_fs $netw
阅读全文
摘要:下载地址:https://github.com/MicrosoftArchive/redis/releases 下载完成后解压并在该目录下cmd。 安装命令:redis-server.exe --service-install redis.windows.conf --loglevel verbos
阅读全文
摘要:1.如果你启动项目时遇到ValueError: embedded null byte报错: 如果你是搭建了一个虚拟环境,请在虚拟环境中找到python解释器下的python\Lib\_strptime.py,这个_strptime.py文件,加入 locale.setlocale(locale.LC
阅读全文
摘要:终端命令操作(导出) 1.导出整个库 mysqldump -u 用户名 -p 数据库名 > 导出的文件名 mysqldump -u root -p blog > ./blog.sql 2导出某个表 mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名 mysqldump -u ro
阅读全文
摘要:ubuntu环境下: 如果你在settings.py文件中已经设置好时区,请打开终端输入命令 date -R 查看一下是否正确,如果不对请 timedatectl set-timezone Asia/Shanghai 修改一下Linux系统时区,然后把时间也修改一下date -s ‘2020-03-
阅读全文
摘要:原文来源:https://blog.csdn.net/liudongdong19/article/details/81283942 本人python版本为:Python 3.6.5 在安装turtle时遇到如下麻烦: 解决的办法就是:https://files.pythonhosted.org/pa
阅读全文