上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页
摘要: 一、CBV与FBV 二、CBV的用法及源码分析 1、用法 #视图层 # 1 先导入View(继承它) from django.views import View # 写一个类继承它, class Test(View): #request必须传,后面的可传可不传(有可能有名,无名分组) def get 阅读全文
posted @ 2019-05-15 21:45 pdun 阅读(532) 评论(0) 推荐(0) 编辑
摘要: RESTful规范 10条规范 总结 django下resful接口规范的编写 class Books(View): # 获取所有图书 def get(self, request): print(type(request)) response = {'status': 100, 'data': No 阅读全文
posted @ 2019-05-15 19:09 pdun 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 一、Vue了解 简单使用 二、Vue实例 1、el:实例 2、data:数据 3、实例的methods <!DOCTYPE html> <html lang="en"> <head> <style> .btn{ width:200px; height:300px; background: red; 阅读全文
posted @ 2019-05-13 10:16 pdun 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 喜欢请打赏 支付宝 微信 扫描二维码打赏 支付宝打赏 了解更多 喜欢请打赏 支付宝 微信 扫描二维码打赏 支付宝打赏 了解更多 喜欢请打赏 支付宝 微信 扫描二维码打赏 支付宝打赏 支付宝 微信 支付宝 微信 扫描二维码打赏 支付宝打赏 扫描二维码打赏 支付宝打赏 扫描二维码打赏 支付宝打赏 了解更 阅读全文
posted @ 2019-05-09 16:45 pdun 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 阅读目录 一 isinstance(obj,cls)和issubclass(sub,super) 二 反射 三 __setattr__,__delattr__,__getattr__ 四 二次加工标准类型(包装) 五 __getattribute__ 六 描述符(__get__,__set__,__ 阅读全文
posted @ 2019-05-09 09:24 pdun 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 数据的读写不一定都是文件,也可能在内存中读写 StringIO(内存中读写str) 要把str写入StringIO,先创建一个StringIO,然后,像文件一样写入即可 要读取StringIO,可以用str初始化StringIO.然后,像读文件一样 BytesIO(内存中读写二进制数据) 先创建By 阅读全文
posted @ 2019-05-07 14:51 pdun 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 首先考虑是么数据库,如果不想使用默认数据库,使用MySQL的话, #setings DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME':'bbs', 'HOST':'127.0.0.1', 'PORT':33 阅读全文
posted @ 2019-05-07 12:09 pdun 阅读(127) 评论(0) 推荐(0) 编辑
摘要: data=b'1111' data = str(data,encoding='utf-8') print(type(data)) data = bytes(data,encoding='utf-8') print(type(data)) 阅读全文
posted @ 2019-04-24 15:53 pdun 阅读(134) 评论(0) 推荐(0) 编辑
摘要: # -auth组件 # -auth是什么? # -django内置的用户认证系统,可以快速的实现,登录,注销,修改密码.... # -怎么用? # -(1)先创建超级用户: # -python3 manage.py createsuperuser # -输入用户名,邮箱(可以不输入),密码,敲回车, 阅读全文
posted @ 2019-04-24 08:16 pdun 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 一、中间件简介 二、自定义中间件 #m1.py from django.shortcuts import HttpResponse from django.utils.deprecation import MiddlewareMixin class Middle1(MiddlewareMixin): 阅读全文
posted @ 2019-04-23 09:13 pdun 阅读(131) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页