上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: django 国际化 1.切到app目录下 python manage.py makemessages -l zh-cn # 校验跟现有po文件的差异性,把多出的英文写在.po文件中 django-admin makemessages -l zh-cn 2.html文件中的翻译 修改项目目录下的.p 阅读全文
posted @ 2020-12-10 16:38 robertzhou 阅读(878) 评论(0) 推荐(0) 编辑
摘要: wkhtmltopdf 转换后 表格不显示 def post(self, request, *args, **kwargs): # 获取的直接是富文本中的html字符串 content = request.DATA.get('content') file_name = request.DATA.ge 阅读全文
posted @ 2020-10-29 14:45 robertzhou 阅读(601) 评论(0) 推荐(0) 编辑
摘要: class TypeBook(models.Model): # 创建时的默认存储位置和保管人 storage_place = models.ForeignKey('StoragePlace', verbose_name=u'存储位置', null=True) admin = models.Forei 阅读全文
posted @ 2020-10-22 10:00 robertzhou 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 将富文本内容导出为pdf 1.使用 xhtml2pdf 缺点 遇到样式问题时会报错,rgba之类的css问题解决不了 from xhtml2pdf import pisa class CourseMaterialExportPdfAPIView(generics.GenericAPIView): p 阅读全文
posted @ 2020-04-02 17:22 robertzhou 阅读(1140) 评论(0) 推荐(0) 编辑
摘要: 支付宝app支付和h5支付 前端代码 阅读全文
posted @ 2019-12-16 19:16 robertzhou 阅读(2005) 评论(1) 推荐(0) 编辑
摘要: class CourseListAPIView(ResponseMixin, generics.ListAPIView) 2)ListAPIView 提供 get 方法,展示对象列表信息 继承自:GenericAPIView、ListModelMixin GenericAPIView,提供了get_ 阅读全文
posted @ 2019-09-18 10:28 robertzhou 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 坏境: web端使用django的auth_user表进行用户登陆认证 由于某种原因app端需使用新用户表进行用户登陆 都采用jwt 验证 基于jwt认证的登陆 执行顺序: 需求: web端登陆使用User表, app端使用CourseUser表 因为判断用户是否存在,是在authenticate_ 阅读全文
posted @ 2019-08-01 15:42 robertzhou 阅读(608) 评论(0) 推荐(0) 编辑
摘要: python2 1.with transaction.commit_on_success()开启事务 2.使用select_for_update来告诉数据库锁定对象,直到事务完成 阅读全文
posted @ 2019-07-31 11:13 robertzhou 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 时间转换和密码,手机的re模块简单校验 python import re,time def check_userinfo(request): pwd = request.POST.get("pwd") if "_" in pwd or re.findall("\W",pwd): return Fal 阅读全文
posted @ 2019-04-21 17:48 robertzhou 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 自定义token 阅读全文
posted @ 2019-04-20 23:24 robertzhou 阅读(4492) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页