10 2021 档案
摘要:react-router-dom https://github.com/remix-run/react-router/blob/main/docs/getting-started/tutorial.md 对于location的变化, 不论是 hashtag方式, 或者是 通过pushstate改变u
阅读全文
摘要:User authentication in Django https://docs.djangoproject.com/en/3.2/topics/auth/ django带有一个用户认证系统,能够处理 用户账户、组、许可、基于cookie的用户会话。 Django comes with a us
阅读全文
摘要:background 基于django和react构建开发环境: django+restframework作为后台API提供者 react+ant design作为前端UI框架 利用django和react的开发工具的热更新功能, 实现前后台代码更新都不需要手动重启server。 如下拓扑图。 首先
阅读全文
摘要:type annotations https://docs.python.org/3.6/library/typing.html 为类类型提示(IDE or 人类可读)设计, 又叫类型注解。 typing — Support for type hints This module supports t
阅读全文
摘要:Draw and Guess Game https://github.com/fanqingsong/draw_guess draw and guess based on django_channels_chat_official_tutorial_react project, create dra
阅读全文
摘要:Invoke https://docs.pyinvoke.org/en/stable/ The invoke CLI tool Details on the CLI interface to Invoke, available core flags, and tab completion optio
阅读全文
摘要:Django Channels Django 仅仅支持 HTTP协议, Channels 扩展了支持的协议类型, 例如 websocket,chat, IoT. 本身实现基于ASGI协议。 但是你也可以选择 同步模式。 https://channels.readthedocs.io/en/stabl
阅读全文
摘要:OverView Django View -- Root https://docs.djangoproject.com/en/3.2/ref/class-based-views/base/#view 所有view视图的基类, 此类不是通用视图,被业务视图继承。 class django.views.
阅读全文
摘要:ViewSets & Routers https://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/ ViewSets是对模型的高度抽象, 让开发者聚焦于建模状态, 和 接口的交互, 基于通用的规则构建URL. REST
阅读全文
摘要:Relationships & Hyperlinked APIs https://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/ 对于表之间的关联关系, ModelSerializer 默认是使
阅读全文
摘要:Authentication & Permissions https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/ 对于view需要限制用户的访问权限, 例如认证 和 许可。 Currently
阅读全文
摘要:Class-based Views https://www.django-rest-framework.org/tutorial/3-class-based-views/ APIView 继承于 django view类提供了 http method 方法的抽象, 即继承于此类的应用类中, 可以定义
阅读全文
摘要:Requests and Responses https://www.django-rest-framework.org/tutorial/2-requests-and-responses/ Request 请求类,扩展了 httprequest类。 请求数据存储在 request.data 成员中
阅读全文
摘要:Django REST framework Django 支持MTV模式, 前端渲染的内容,放在了后端 template中实施,包括获取数据,渲染模板一系列过程都在候选执行。 在前端能力强大的现在, 前后端分离开发模式已经成为主流, 所以后端只提供API, 于前端进行数据交互,成为业界主流。 此框架
阅读全文
摘要:Metaclasses https://www.python.org/dev/peps/pep-3115/ 元类的诞生是来自于大量有趣的用例, 要求在类创建的过程中,就可以参与到类的定制逻辑中去。 The primary reason for changing the way metaclasses
阅读全文
摘要:https://docs.djangoproject.com/en/3.2/misc/design-philosophies/#cache-design-philosophy Loose coupling 低耦合 高内聚-低耦合是其设计目标。 不同的层不需要知道其它层, 除非是绝对必要。 例如: 模
阅读全文