随笔分类 -  Coding-Python

Data analysis
摘要:本篇,计划针对 [Django] 10 - Routable Pages & Sitemaps of Wagtail,讨论下 “页码和分类” 同时显示的问题。 Todo list. from modelcluster.contrib.taggit import ClusterTaggableMana 阅读全文
posted @ 2021-01-04 20:47 郝壹贰叁 阅读(74) 评论(0) 推荐(0) 编辑
摘要:写在前面 Ref: Enable the v2 API to Create a Headless CMS 学完之前的章节,也算是正式宣告度过了Django阶段,开始入门了 Wagtail。 REST FRAMEWORK 一、配置 mysite/settings/base.py 'wagtail.ap 阅读全文
posted @ 2021-01-01 21:38 郝壹贰叁 阅读(414) 评论(0) 推荐(0) 编辑
摘要:为外界提供了交互式的窗口。比较好看,开发快,且动态修改,赞! Ref: https://github.com/CodingForEverybody/learn-wagtail/commit/d67bc5659ca023c21d8a9f01d30604f6d67cd2d6 代码注意这里,应该是“sub 阅读全文
posted @ 2021-01-01 10:40 郝壹贰叁 阅读(189) 评论(0) 推荐(0) 编辑
摘要:基本知识点 一、Orderables How to use Orderables in Wagtail CMS Discover how to use Djangos Inline Models within a Wagtail Page in a feature called Orderable. 阅读全文
posted @ 2020-12-30 21:02 郝壹贰叁 阅读(145) 评论(0) 推荐(0) 编辑
摘要:Ref: Wagtail CMS: How to subclass Wagtail Pages 使用继承 ORM 一、 继承 - Create new ORM [ blog/models.py ] 疑问,是否也同时继承了 InlinePanel 的部分?有的! # First subclassed 阅读全文
posted @ 2020-12-29 13:55 郝壹贰叁 阅读(142) 评论(0) 推荐(0) 编辑
摘要:A snippet is a small section of text or source code that can be inserted into the code of a program or Web page. Snippets provide an easy way to imple 阅读全文
posted @ 2020-12-28 18:32 郝壹贰叁 阅读(186) 评论(0) 推荐(0) 编辑
摘要:创建一个简单的 Django 项目 Ref: https://www.runoob.com/django/django-first-app.html Ref: https://www.runoob.com/django/django-template.html 一、基本套路 |-- HelloWor 阅读全文
posted @ 2020-12-25 14:43 郝壹贰叁 阅读(129) 评论(0) 推荐(0) 编辑
摘要:Ref: Blog Listing Page, Blog Detail Pages, and Adding Custom Context to your Wagtail CMS Site【创建 blog list】 Ref: How to Add Routable Pages to your Wag 阅读全文
posted @ 2020-12-23 14:27 郝壹贰叁 阅读(143) 评论(0) 推荐(0) 编辑
摘要:设置子目录 一、站点小链接 设计 可见,添加了一个二级目录,未来还需要设定翻译内容。 问:模型写好后,如何绑定到这个侧边栏目录位置的呢? > 先配置,再注册 register 配置 (1) 创建自定义 app: site_settings,但删去其中的 admin.py。 (2) 添加系统 app: 阅读全文
posted @ 2020-12-23 10:00 郝壹贰叁 阅读(156) 评论(0) 推荐(0) 编辑
摘要:怎么说呢,streamfield 太赞了! 用户页面 一、基本套路 定义 (1) 添加 app: streams, (2) 新建 一个文件 blocks.py (3) 定义 各种 block 类,如下: TitleAndTextBlock。 """ Streamfields live in here 阅读全文
posted @ 2020-12-19 19:26 郝壹贰叁 阅读(303) 评论(0) 推荐(0) 编辑
摘要:传统方法 一、资源 系列视频:Django Project - Build a Simple Blog,几个热身的知识点如下: namespace Ref: 实战Django的URL命名空间namespace【多用户时可能会用到】 model.manager Ref: Django 框架之 自定义m 阅读全文
posted @ 2020-12-19 15:19 郝壹贰叁 阅读(229) 评论(0) 推荐(0) 编辑
摘要:Ref: https://testdriven.io/courses/tdd-django/api-documentation/ 一、安装 文件:requirements.txt drf-yasg==1.17.1 文件:settings.py 集成 “装备”。 # app/drf_project/u 阅读全文
posted @ 2020-12-19 06:30 郝壹贰叁 阅读(318) 评论(0) 推荐(0) 编辑
摘要:第一部分 Test in CI Using the image that we created in the build stage along with the Postgres service, we run Pytest, Flake8, Black, and isort in the tes 阅读全文
posted @ 2020-12-16 18:54 郝壹贰叁 阅读(181) 评论(0) 推荐(0) 编辑
摘要:故事背景 Ref: Amazon RDS for PostgreSQL 一、本地ORM访问PostgreSQL 本地时,如何访问的 PostgreSQL,参见:[Django] 02 - Django REST Framework (DRF) 首先,在 .env.dev 设置sql的相关环境变量。 阅读全文
posted @ 2020-12-15 10:50 郝壹贰叁 阅读(156) 评论(0) 推荐(0) 编辑
摘要:ELK - [Elasticsearch + Logstash + Kibana] docker-elk-tutorial Youtube Tutorial PART 1 - ELK 簡介 Youtube Tutorial PART 2 - docker ELK 環境建立 Youtube Tutor 阅读全文
posted @ 2020-12-14 20:35 郝壹贰叁 阅读(414) 评论(0) 推荐(0) 编辑
摘要:Ref: SQLAlchemy 教程 —— 基础入门篇 本课程带领大家使用 SQLAlchemy 连接 MySQL 数据库,创建一个博客应用所需要的数据表,并介绍了使用 SQLAlchemy 进行简单了 CURD 操作及使用 Faker 生成测试数据。 [CDH] Cloudera's Distri 阅读全文
posted @ 2020-12-08 06:05 郝壹贰叁 阅读(130) 评论(0) 推荐(0) 编辑
摘要:上一回说道: docker-compose exec api python manage.py recreate_db # 那么自然也可以触发pytest的命令 docker-compose exec api python -m pytest "src/tests" $ docker-com 阅读全文
posted @ 2020-11-29 07:54 郝壹贰叁 阅读(131) 评论(0) 推荐(0) 编辑
摘要:Ref: 从 Flask-script 迁移到 Click @click.group() 一、'函数' 变成 '命令' 将一个普通的函数转化为一个命令行工具,还为它提供了选项、参数等,并且自动生成了帮助信息。 import click @click.group() defgit(): '''Thes 阅读全文
posted @ 2020-11-27 13:25 郝壹贰叁 阅读(201) 评论(0) 推荐(0) 编辑
摘要:Ref: Learn Open API Specification (SWAGGER) - FOR BEGINNERS(2020)【Udemy不长的一个教学视频】 Ref: https://testdriven.io/courses/tdd-flask/【教程】 Ref: Flask-RESTPlu 阅读全文
posted @ 2020-11-25 12:15 郝壹贰叁 阅读(292) 评论(0) 推荐(0) 编辑
摘要:Ref: Test-Driven Development with Django, Django REST Framework, and Docker Tools and Technologies Python Django Docker Postgres Pytest Django REST Fr 阅读全文
posted @ 2020-11-24 18:53 郝壹贰叁 阅读(85) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示