Project Development Notes - August New Project - School Bus Project
Model/Database Design Suggestions from django.db import models from django.utils import timezone class ModelManager(models.Manager): def get_queryset(self, *args, **kwargs): return super().get_queryset(*args
目录8 个章节
Model/Database Design Suggestions
from django.db import models
from django.utils import timezone
class ModelManager(models.Manager):
def get_queryset(self, *args, **kwargs):
return super().get_queryset(*args, **kwargs).filter(is_deleted=False)
class ModelExt(models.Model):
objects = ModelManager()
is_deleted = models.BooleanField('是否已删除', default=False)
created_time = models.DateTimeField('创建时间', default=timezone.now)
updated_time = models.DateTimeField('更新时间', default=timezone.now)
class Meta:
abstract = True
Syncing Model Comments to the Database
https://github.com/starryrbs/django-comment-migrate
drf-yasg and Swagger
drf-yasg or drf-yasg2?
Swagger in Django is essentially an App, making it convenient to integrate with the project's unified authentication system
Swagger in ASP.NET Core is middleware and requires extra configuration
Captcha
Continue using django-simple-captcha for image captchas
Expiration time is stored in the database; if the timezone is misconfigured, captchas will always appear expired
https://django-simple-captcha.readthedocs.io/en/latest/usage.html
Django Filter
- Django-filter, making filtering this simple: https://zhuanlan.zhihu.com/p/110060840
- Django (69) The best filter plugin Django-filter: https://www.cnblogs.com/jiakecong/p/14920543.html
Django Admin SimpleUI Custom Columns
https://simpleui.72wo.com/topic/1266
Message Queue: Django-Q
Scheduled tasks have some issues; the minimum interval is one minute
References
- Django official documentation "Model
Metaoptions": https://docs.djangoproject.com/zh-hans/3.2/ref/models/options/ - It's 2021, you really should consider PostgreSQL (1): https://chinese.freecodecamp.org/news/2021-postgres-1/
_EOF_
Project Development Notes - August New Project - School Bus Project
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
项目完成小结-11月新项目-诊所项目
前言 最近有个项目到一段落,做个小结记录。 内容可能会多次补充,在博客上实时更新哈~ 如果是在公众号阅读这篇文章,可以点击「查看原文」访问最新版本~ 这个项目是前后端分离,后端为了快,依然用我的DjangoStarter框架。前端一开始是小程序,后面突然换成公众号H5的形式,还好我用了Taro,大差不差。 不过Taro目前没啥好用成熟的组件库,前一个项目本来用着Taroify,不过用了一半项目还没
2023-05-07 · 项目开发小结系列 · 约 1 分钟
项目完成小结-民政局项目-Django3.x版本-开发部署小结
前言 最近因为政企部门的工作失误,导致我们的项目差点挂掉,客户意见很大,然后我们只能被动进入007加班状态,忙得嗷嗷叫,直到今天才勉强把项目改完交付,是时候写一个小结。 技术 因为前期需求不明确,数据量不大,人手也不多,所以我直接用Django做了后端,Django自带的admin可以作为管理后台使用,可以很快完成这个需求。 我们的前端有两个,一个数据展示大屏,一个可视化地图。前者使用Vue+El
2022-04-25 · 项目开发小结系列 · 约 1 分钟
项目完成小结:使用Blazor和gRPC开发大模型客户端
其实几年前我就有轻度使用了一下 Blazor 这个技术,一开始使用 Blazor ,我是有点嫌弃的,我还是比较倾向于传统的前后端分离,AspNetCore用来做后端,用 React 做前端,生态很丰富,要做啥组件都容易。这次只是个小 Demo 项目,试用了一下 Blazor ,从一开始的非常别扭,到越来越顺手。感觉 Blazor Server 写小项目还是挺好用的,后面继续完善项目,持续发掘 B
2023-07-14 · 项目开发小结系列 · 约 1 分钟
项目小结:使用Docker迁移服务到离线服务器
最近遇到的这个场景,需要把之前开发的一套系统迁移到一个离线的服务器上,这个服务器有点麻烦,接入VPN后通过堡垒机才能访问,速度也很慢,遇到不少坑,本文记录一下迁移过程。
2023-07-12 · 项目开发小结系列 · 约 1 分钟
讨论
共 0 条加载评论中…