上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 55 下一页

2018年8月1日

python版本坑:md5例子(python2与python3中md5区别)

摘要: 对于一些字符,python2和python3的md5加密出来是不一样的. Python2 和Python3MD5加密 阅读全文

posted @ 2018-08-01 10:07 星河赵 阅读(6775) 评论(0) 推荐(0) 编辑

2018年7月30日

type、object和class的关系

摘要: 阅读全文

posted @ 2018-07-30 15:18 星河赵 阅读(117) 评论(0) 推荐(0) 编辑

单独的 python 脚本文件使用 django 自带的 model

摘要: django1.9.5&python3.4.4 文件结构 在一个爬虫脚本中将爬取的数据通过django自带的model保存到数据库 修改的文件(其余pycharm新建Django项目生成,未修改): # testapp/models.py from django.db import models c 阅读全文

posted @ 2018-07-30 10:01 星河赵 阅读(1292) 评论(0) 推荐(0) 编辑

2018年7月23日

Django admin 常用方法

摘要: 1.调整页面头部显示内容和页面标题 阅读全文

posted @ 2018-07-23 12:30 星河赵 阅读(284) 评论(0) 推荐(0) 编辑

2018年7月16日

Django admin 常用方法 model 增加只读权限

摘要: 1.Django admin model 设置查看权限 Django model 默认只有增加、删除、修改权限。没有查看权限 admin 文件 阅读全文

posted @ 2018-07-16 13:44 星河赵 阅读(4402) 评论(0) 推荐(0) 编辑

2018年7月13日

Django 批量保存图片文件 自定义上传方法

摘要: 1.前端通过formData的方式批量增加图片或文件 AJAX写法 View写法 自定义上传方法 阅读全文

posted @ 2018-07-13 10:57 星河赵 阅读(533) 评论(0) 推荐(0) 编辑

2018年7月7日

Pycharm 激活码

摘要: Pycharm 激活码 阅读全文

posted @ 2018-07-07 08:44 星河赵 阅读(466) 评论(0) 推荐(0) 编辑

2018年7月3日

Django项目关闭debug模式后,静态文件无法加载的解决办法

摘要: 开启内置服务器,由于项目中local_settings.py文件中的DEBUG=True,进行开发和调试一直没什么问题。 但是现在需要编写404,500等出错页面,在debug模式下出了错都会出现报错页面,无法转向到404或500页面,这时我将local_settings.py中的DEBUG设为fa 阅读全文

posted @ 2018-07-03 14:31 星河赵 阅读(1340) 评论(0) 推荐(0) 编辑

2018年7月2日

python 获取环境变量

摘要: python 获取环境变量 参考 https://docs.python.org/2/library/os.html 使用os.environ获取环境变量字典 阅读全文

posted @ 2018-07-02 14:38 星河赵 阅读(31211) 评论(0) 推荐(1) 编辑

django 中多字段主键(复合、联合主键)

摘要: django中不支持双主键、多主键。 要实现类似功能可以: classMeta: unique_together=(("driver","restaurant"),) 里边两个元素联合去重的。 既是复合主键 注意使用这种方法不要设置主键,让django自己生成一个id作为主键即可。 参考:http: 阅读全文

posted @ 2018-07-02 11:28 星河赵 阅读(9786) 评论(1) 推荐(0) 编辑

上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 55 下一页

导航