04 2020 档案
摘要:Flask 用的是 CBV, 原先的用户认证用的是自己写的一个 auth 的装饰器, 后面改成了在 before_request 中进行用户认证,而且应前端的要求, 当用户登陆认证失败后的 STATUS 要改为 401 (原先是用默认的 200)。当有了这两个改动后, 发现原先已写好的代码又出现了跨
阅读全文
摘要:Class metaprogramming is the art of creating or customizing classes at runtime. Classes are first-class objects in Python, so a function can be used t
阅读全文
摘要:Descriptors are a way of resuing the same access logic in multiple attributes. For example, field types in ORM such as the DjangoORM and SQL Alchemy a
阅读全文