- 博客(7)
- 收藏
- 关注
原创 Django models.py 加外键时候报错ValueError: The database backend does not accept 0 as a value for AutoField.
这错误主要原因是修改了原来的外键,改变了表名(Class xxx(modles.Model):),错误原因是迁移文件冲突:修改方法:migrations文件下面除了__int__.py全部删除掉,重新迁移命令(python mange.py migratons 和migrate )由于我的数据库是刚搭建状态,没重要数据,这么修改比较快感谢提供帮助:https://blog.youkuaiyun.com/weixin_42322444/article/details/105498775...
2021-11-17 21:23:07
1491
2
原创 win10各个版本激活码到期了
emmmmm在C上看了好多帖子,最终用了老办法,去某宝买了个激活码,花了15块单台电脑永久激活……试了很多方法KMS等无法解决的小伙伴,可以花钱解决。以上
2021-01-29 12:18:49
7846
5
原创 使用scrapy爬数据时候 IndexError: list index out of range
错误原因:xpath解析数据成列表list, 取列表list[0]时列表其实是空的,list index out of range错误代码如下:content_list = response.xpath('//html/body/div[1]/div[4]/div[4]/div[2]/div/div') for cont in content_list: re_name = cont.xpath('./div/div[2]/div[1]/span/a/text()
2020-08-25 11:09:01
944
原创 scrapy管道存储时报错:AttributeError: ‘NoneType‘ object has no attribute ‘write‘
练习scrapy框架的管道存储时报错,报错代码:class JuliveproPipeline: fp = None def start_spider(self,spider): print('_______start crawl……') self.fp = open('./julive.txt','w',encoding='utf-8') def process_item(self, item, spider): name = i
2020-08-23 22:36:46
5086
5
原创 webdriver.Firefox 和 webdrever.firefox
进度selenium第一节课,讲了一下浏览器驱动下载。课程老师用的是Chrome,自己用的是Firefox于是遇到了一个问题。在浏览器实例化的时候报错代码:from selenium import webdriver#实例化浏览器expro = webdriver.firefox(executable_path='./geckodriver.exe')报错如下:Traceback (most recent call last): File “C:/Pycharm/PyCharmCo
2020-08-11 18:07:58
481
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人