03 2018 档案

摘要:1、倒入random模块 2、在settings文件中添加useragent列表 阅读全文
posted @ 2018-03-20 16:07 破晓e 阅读(151) 评论(0) 推荐(0)
摘要:1、在settings文件中添加ip池 IPPOOL=['xxx.xx.xx.xx','xxx.xx.xxx.xx'] 2、在middleware文件中添加自己的代理ip类(首先需要导入ipPOOL,random模块) class Myproxymiddleware(object): def __i 阅读全文
posted @ 2018-03-20 15:50 破晓e 阅读(367) 评论(0) 推荐(0)
摘要:#encoding:utf-8 from django.contrib import admin from son10.models import * # Register your models here. class testadmin(admin.ModelAdmin): #设置要显示在列表中的字段 list_display = ['name','pwd'] #分... 阅读全文
posted @ 2018-03-15 18:27 破晓e 阅读(162) 评论(0) 推荐(0)
摘要:python manage .py makemigrations appname python manage.py migrate 阅读全文
posted @ 2018-03-15 16:42 破晓e 阅读(106) 评论(0) 推荐(0)
摘要:在settings中设置 LANGUAGE_CODE = ‘zh-Hans’ 阅读全文
posted @ 2018-03-15 16:39 破晓e 阅读(133) 评论(0) 推荐(0)
摘要:使用创建函数__new__() 阅读全文
posted @ 2018-03-14 18:31 破晓e 阅读(100) 评论(0) 推荐(0)
摘要:ps -ef |grep python |awk '{print $2}'|xargs kill -9 阅读全文
posted @ 2018-03-12 11:37 破晓e 阅读(386) 评论(0) 推荐(0)