会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Gnomeshghy
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
5
6
下一页
2021年12月7日
requirements相关
摘要: 主要使用目的:任何应用程序通常需要设置安装所需并依赖一组类库来满足工作要求。要求文件是指定和一次性安装包的依赖项具体一整套方法。 1.用git将项目拉下来 2.配置虚拟环境 3.最后执行pip install -r requirements.txt -i https://pypi.tuna.tsin
阅读全文
posted @ 2021-12-07 09:27 Gnomeshghy
阅读(37)
评论(0)
推荐(0)
2021年9月1日
day67
摘要: 函数与方法的区别 # 函数 def test(a, b): print(a, b) print('我是函数') # 有几个参数就要传几个参数 # test(1, 2) # 方法 class Person(object): # 没有任何装饰器装饰,绑定给对象的方法 # 特殊之处:对象来调用,会自动传值
阅读全文
posted @ 2021-09-01 22:03 Gnomeshghy
阅读(204)
评论(0)
推荐(0)
2021年8月31日
CBV源码分析;drf之APIView执行流程分析;drf之Request对象;序列化组件之Serializer的使用 # day66
摘要: CBV源码分析 # 我们在路由中写了 IndexView.as_view() >实际上放了一个函数内存地址,源码是 》实际上是view的内存地址 @classonlymethod def view(request, *args, **kwargs): return self.dispatch(req
阅读全文
posted @ 2021-08-31 20:20 Gnomeshghy
阅读(54)
评论(0)
推荐(0)
2021年8月30日
web开发模式;API接口;POSTMAN的使用;Restful规范;序列化;drf介绍与安装 # day65
摘要: 1 Web开发模式(**) # 前后端混合开发模式# 前后端分离 2 API接口(**) #api接口:前后台信息交互的媒介#类似于这种:https://api.weibo.com/2/statuses/show.json 3 POSTMAN的使用() # 接口测试工具# 安装:无脑双击# post
阅读全文
posted @ 2021-08-30 22:03 Gnomeshghy
阅读(242)
评论(0)
推荐(0)
2021年8月28日
day64
摘要: {% extends 'base.html' %}{% block css %} <style> #div_digg { float: right; margin-bottom: 10px; margin-right: 30px; font-size: 12px; width: 125px; tex
阅读全文
posted @ 2021-08-28 19:08 Gnomeshghy
阅读(29)
评论(0)
推荐(0)
2021年8月27日
day63
摘要: 开放对外访问的接口 1、在配置文件中添加字段 MEDIA_ROOT = os.path.join(BASE_DIR, 'media') 2、在页面中注册一个新的用户并上传图片,上传后会在django目录下新建一个文件夹media/static/img/ ,并将上传的文件保存在新建的文件夹下 3、在u
阅读全文
posted @ 2021-08-27 21:41 Gnomeshghy
阅读(31)
评论(0)
推荐(0)
2021年8月26日
day62
摘要: view.py from django.shortcuts import render, HttpResponsefrom django.http import JsonResponsefrom app01 import modelsimport hashlibimport randomfrom d
阅读全文
posted @ 2021-08-26 22:04 Gnomeshghy
阅读(29)
评论(0)
推荐(0)
2021年8月25日
day61
摘要: view.py from django.shortcuts import render, HttpResponsefrom django.http import JsonResponsefrom app01 import modelsimport hashlibimport randomfrom d
阅读全文
posted @ 2021-08-25 22:39 Gnomeshghy
阅读(46)
评论(0)
推荐(0)
2021年8月23日
扩展auth_user表;项目开发流程;BBS数据表分析;BBS表设计;注册页面的搭建 # day60
摘要: 扩展auth_user表 前提:一旦执行过迁移命令,就不能再扩展了 1、要想扩展auth_user表,必须继承AbstractUser类 2、必须在settings.py中,写一个配置,AUTH_USER_MODEL = 'app01.UserInfo' from django.contrib.au
阅读全文
posted @ 2021-08-23 22:08 Gnomeshghy
阅读(108)
评论(0)
推荐(0)
2021年8月20日
CBV添加装饰器;中间件介绍;自定义中间件介绍;csrf跨站请求;csrf验证的装饰器;auth模块 # day59
摘要: CBV添加装饰器 创建一个装饰器用于判断用户是否登录 def login_auth(func): def inner(request, *args, **kwargs): if request.COOKIES.get('username'): return func(request, *args,
阅读全文
posted @ 2021-08-20 21:21 Gnomeshghy
阅读(40)
评论(0)
推荐(0)
1
2
3
4
5
6
下一页
公告