会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
spidernyp
博客园
首页
新随笔
联系
订阅
管理
1
2
3
下一页
2020年9月8日
django mysql
摘要: 在项目文件夹中的 __init__.py 中添加如下代码: import pymysql pymysql.install_as_MySQLdb() 修改settings中有数据库的设置 # 'default': { # 'ENGINE': 'django.db.backends.sqlite3',
阅读全文
posted @ 2020-09-08 08:20 spidernyp
阅读(94)
评论(0)
推荐(0)
2020年8月6日
cmd requests.ge 乱码
摘要: cmd python import re import requests t = requests.get("http://xxx.xxx") t.encoding = 'utf-8' t.text 则正确显示
阅读全文
posted @ 2020-08-06 12:49 spidernyp
阅读(131)
评论(0)
推荐(0)
2020年8月3日
添加新的spider导致的spider not found 和 compass 看不到手动创建的collections
摘要: 将spider文件直接拷到服务器上,执行,提示spider not found kwq 回到本地测试,发现只有scrapy genspider kwq sxmu.edu.cn生成文件后,再按原先的爬虫文件格式修改才可以被正常执行 后在服务器上测试,发现确实如此。 本次测试,涉及到pip文件和item
阅读全文
posted @ 2020-08-03 23:04 spidernyp
阅读(181)
评论(0)
推荐(0)
2020年7月23日
linux 近期常用的操作命令
摘要: 查看linux内核版本 cat /proc/version 查看操作系统 cat /etc/redhat-release 启动 systemctl start firewalld 查看状态 systemctl status firewalld 或者 firewall-cmd --state 停止 s
阅读全文
posted @ 2020-07-23 15:55 spidernyp
阅读(109)
评论(0)
推荐(0)
2020年7月21日
django+nginx+uwsgi+django
摘要: 本地开发一个新闻站的数据分析平台,花三天时间终于成功部署在linux平台上。 几年前,实施过linux的web服务器,对linux的操作只了解一些皮毛,这次部署也是按部就班、战战兢兢,参考了许多网友大牛的技术资料,也踩过了好多坑,现在整理一下。 基础条件:centos7.8 1.系统更新,安装基础环
阅读全文
posted @ 2020-07-21 21:19 spidernyp
阅读(193)
评论(0)
推荐(0)
2020年5月2日
mongodb 排序输出 if no direction is specified, key_or_list must be an instance of list
摘要: 解决方法: db.collection.find().sort([("name", 1), ("age" , 1)]) 原因:在python中只能使用列表进行排序,不能使用字典
阅读全文
posted @ 2020-05-02 10:58 spidernyp
阅读(1573)
评论(0)
推荐(2)
mongodb 将字符串格式改为整数
摘要: db.getCollection('syxw').find({'click':{$type:2}}).forEach(function(x){x.click=NumberInt(x.click);db.getCollection('syxw').save(x);}) use sxmu 再执行,将sy
阅读全文
posted @ 2020-05-02 10:40 spidernyp
阅读(1268)
评论(0)
推荐(0)
2020年4月22日
django 3.0 文档学习笔记
摘要: 1异常处理 常规办法 try: question = Question.objects.get(pk = question_id) except Question.DoesNotExist: raise Http404("sorry no exist") 新写法 from django.shortc
阅读全文
posted @ 2020-04-22 12:12 spidernyp
阅读(371)
评论(0)
推荐(0)
2020年4月13日
sublime less css less-plugin-clean-css lessc
摘要: 在sublime中安装less转css插件 1.在sublime.中安装less2css,提示需要安装lessc 2.在node.js中,npm install lessc -g 3.在sublime中提示需clean-css插件 4.在node.js中,安装less-plugin-clean-cs
阅读全文
posted @ 2020-04-13 10:10 spidernyp
阅读(223)
评论(0)
推荐(0)
2020年4月1日
matplotlib 中文显示问题
摘要: 找到site-packages\matplotlib\mpl-data\matplotlibrc中的 font.serif和font.sans-serif前添加“SimHei” 即可正常显示微软雅黑也可以添加其它字体,这样可以一劳永逸的解决中文显示问题,不用在程序中定义font
阅读全文
posted @ 2020-04-01 23:05 spidernyp
阅读(119)
评论(0)
推荐(0)
1
2
3
下一页
公告