上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: 首先要设置settings # 上传文件 MEDIA_ROOT = 'media' # 项目下的目录 MEDIA_URL = "/media/" # 跟STATIC_URL类似,指定用户可以通过这个url找到文件 setting 设置模板中使用MEDIA_URL TEMPLATES = [ { 'B 阅读全文
posted @ 2020-02-28 16:03 Neroi 阅读(176) 评论(0) 推荐(0) 编辑
摘要: pip install pip install django-widget-tweaks 注册: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'dja 阅读全文
posted @ 2020-02-01 21:48 Neroi 阅读(629) 评论(0) 推荐(0) 编辑
摘要: req=requests.post(domain,params,json=None) req=req.content.decode() 阅读全文
posted @ 2019-11-12 14:36 Neroi 阅读(255) 评论(0) 推荐(0) 编辑
摘要: import numpy as np ls2 = np.arange(10) list(ls2) type(ls2) #numpy.ndarray 简单的方法: np.ones([3,4]) #返回元素全为1的3×4二维数组 np.zeros([2,3])#返回元素全为0的2×3二维数组 array 阅读全文
posted @ 2019-10-31 15:36 Neroi 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 原本使用循环: def gen_num(): nums = [] for i in range(10): print(f'生成数据:{i}') nums.append(i) return nums nums = gen_num() for num in nums: print(f'打印数据:{num 阅读全文
posted @ 2019-10-31 14:48 Neroi 阅读(136) 评论(0) 推荐(0) 编辑
摘要: shutil模块是高级的文件操作模块。之前学习的os模块之提供了对文件和目录进行一些简单的操作 功能。但是像 移动、复制、打包、压缩、解压等功能os模块都没有提供。shutil模块其实是对os模块的补充。下面我们简单的介绍一下shutil模块的使用。 1、shutil的复制功能 shutil.cop 阅读全文
posted @ 2019-10-29 15:00 Neroi 阅读(488) 评论(0) 推荐(0) 编辑
摘要: f==format p==parse 1、获取当前时间(日期格式) 2、由日期格式转化为字符串格式的函数为: datetime.datetime.strftime() 3、由字符串格式转化为日期格式的函数为: datetime.datetime.strptime() 4、两个函数都涉及日期时间的格式 阅读全文
posted @ 2019-09-12 20:24 Neroi 阅读(10751) 评论(0) 推荐(1) 编辑
摘要: 执行原生SQL: 1 from django.db import connection, connections 2 cursor = connection.cursor() 3 cursor.execute( 4 """select * from tb where nid=%s""",[user. 阅读全文
posted @ 2019-03-20 15:33 Neroi 阅读(953) 评论(0) 推荐(0) 编辑
摘要: 1 <select id="question"> 2 {# 常见问题。ajax用editor.html('1231254')填充#} 3 <option value="1">手机问题</option> 4 <option value="2">电脑无法开机</option> 5 <option val 阅读全文
posted @ 2019-03-20 13:43 Neroi 阅读(747) 评论(0) 推荐(0) 编辑
摘要: 200 成功 301/302永久性重定向/临时重定向 403没有访问权限 404没有对应资源 500服务器错误 503服务器停机或正在维护 阅读全文
posted @ 2019-03-17 15:34 Neroi 阅读(114) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页