自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (2)
  • 收藏
  • 关注

原创 docker netwok 相关配置

新建容器时,指定网桥以及网络下的别名run 的时候 指定 --network 网桥名 --network-alias 别名即可,创建后通网络的docker 就可以用别名代替IPsudo docker run -di --name ops_rabbit --network docker-elk_elk --network-alias rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15.

2021-12-09 18:00:00 1371

原创 uwsgi 启动或停止

停止:uwsgi --stop uwsgi.pid启动:uwsgi --ini uwsgi.iniuwsgi.pid 是ini配置文件中配置的例子uwsgi --stop /tmp/ops-master.pid查看日志tail -50f /tmp/ops-uwsgi.log

2021-11-12 14:56:16 2607

原创 django 自动createsuperuser,主要是方便docker部署

echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@myproject.com', 'password')" | python manage.py shell

2021-11-12 13:51:46 1252

原创 Docker创建 django虚拟环境

1 Dockerfile 内容如下:FROM python:3.7ENV PYTHONUNBUFFERED 1WORKDIR /rootCOPY pip.conf /root/.pip/pip.confCOPY . /rootEXPOSE 22 8000RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \ mv /root/sources.list /etc/apt/sources.list &

2021-10-11 11:51:59 255

原创 django 删除表后通过模型重建

删除数据库中的migrate记录select * FROM django_migrationsdelete from django_migrations where app=‘operations’;2 删除对应app中migrations文件夹下的_pycache_ 和 migrate文件(除了__init__.py都删除)3. 重新makemigrations 和migrate...

2021-09-07 18:19:22 74

原创 vscode配置django 推荐插件

Git historyPythonDjangoDjango Templatejquery Code SnippetsBootstrap 3 Snippets

2021-08-19 17:16:13 4522 1

原创 django2.2+xadmin2 踩坑合集

执行python manage.py makemigrations报错 ImportError: cannot import name ‘SKIP_ADMIN_LOG‘ from ‘import_export.admin‘解决办法:把 48行复制一行然后注释掉,在49行里 去掉 SKIP_ADMIN_LOG, TMP_STORAGE_CLASS,换成 ImportMixin为什么要换成这个是因为 ImportMixin 这个类里写了 skip_admin_log 和 tmp_storage_cl.

2021-06-06 16:41:41 221

原创 ubuntu14 DEll inter 15bb网卡驱动

Building and InstallationTo build a binary RPM* package of this driver, run ‘rpmbuild -tbe1000e-<x.x.x>.tar.gz’, where <x.x.x> is the version number for the driver tarfile.Note: For the build to work properly, the currently running kernel M

2021-03-27 21:40:07 626 1

转载 Pyinstaller Failed to execute script 错误排查方法

先直接打包 运行: pyinstaller main.py这样打包是绿色版,会显示报错1、取消 -w 参数,让他显示命令窗口;2、按住shift,右击鼠标,选择 “在此处打开powershell”(或命令窗口);3、将生成的exe拖入,按回车;4、可以看到具体的报错信息;5、如果是“unable to find Qt5xx.dll”,就将Python安装路径下的/Lib/site-packages/PyQt5/Qt/bin添加到环境变量;6、如果是“no module xxx”,就p

2021-02-23 15:42:07 1519

原创 QThread: Destroyed while thread is still running 错误

class xxx(): xxx def ip_ping(self): self.t = QThread() self.worker = NetWork() self.worker.mySignal.connect(self.myprint) self.worker.moveToThread(self.t) self.t.started.connect(self.worker.ip_ping) s.

2021-02-14 20:37:51 406

转载 转载其他人的pyqt多线程方法

此篇博客是对上述两篇博客的补充。参考这篇博客:http://themkbytes.blogspot.kr/2012/05/pyqt-gui-freeze-while-loops.html得出如下结论,主线程中如果有一些耗时的计算,界面会暂时失去响应,那么,在计算的过程中,可以调用下界面的processEvents方法,让整个程序继续执行,处于事件循环中。代码主要如下:耗时导致界面失去响应的代码:import itertools ,stringx=1file=open("file","w")w

2020-12-26 17:51:30 91

原创 pyinstaller 打包及 ubuntu版本的安装

一、pyinstaller的安装和打包建议使用ubuntu18以上,安装比较方便。sudo apt-get install python3-pip pip install pyinstaller安装openssh方便传文件:sudo apt-get install openssh-server如果报错需要安装更高版本的 openssh-client参考提示版本即可,例如:sudo apt-get install openssh-client=1:7.6p1-4然后在安装serverp

2020-10-27 21:22:02 1944

原创 新建Django项目流程及mysql5.7允许远程访问

mysql设置允许远程访问配置conf中的允许IP访问sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf将 bind-address = 127.0.0.1 注释掉,或者在后方加入 空格+允许访问的IP地址进入数据库中设置 帐号允许远程访问的数据库权限GRANT ALL PRIVILEGES ON . TO ‘mysql’@’%’ I...

2020-05-04 11:36:10 184

原创 ubuntu14设置定时任务,每天同步ntp时间

本操作主要是针对ubuntu14系统的视频盒子、服务器等出现系统时间与云段时间偏差较大且无法自动恢复的问题。主要解决思路是:先关闭ntp服务,同步阿里云时间,启动ntp服务,并将时间更新到硬件时钟内,检查系统是否可正确启用ntp、同步时间服务器地址等,建议先依次输入以下命令,检查一遍是否命令可正常运行,时间同步是否正常。Sudo /etc/init.d/ntp stopSudo ntpd...

2020-05-04 11:28:58 1737

原创 crontab中使用root执行命令,以及取消sudo 需要输入密码的方法。

crantab定时任务中添加shell,下方是解决办法。若shell中包含sudo则提示:no tty present and no askpass program specified解决办法1:进入/etc/sudoers.d 建立任意一个不是.和~结尾的文件(名称随意),里面输入:sensetime ALL=(ALL) NOPASSWD: ALL # 若写ALL...

2020-04-22 23:09:44 4070

原创 Django2.2与Python3.7之间的一些兼容设置

豆瓣源安装pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com django==2.2配置mysql数据库提示没有nameAPP后pip install -i http://pypi.douban.com/simple --trusted-host pypi.douban.com mysqlcl...

2020-04-15 20:21:18 384

ubuntu14 DEll inter 15bb网卡驱动

e1000e-3.4.2.4.tar.gz(实测可用) e1000e-3.84.tar.gz

2021-03-27

JSMinNPP.rar

放倒notepadd ++的插件文件夹,重启软件即可

2021-03-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除