上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 28 下一页
摘要: from itsdangerous import TimedJSONWebSignatureSerializer as Serializer 1 实例化对象 serializer = Serializer('secretkey', 3600) # 3600 代表过期时间 单位秒2 加密信息info 阅读全文
posted @ 2020-02-04 00:04 夜晚的潜水艇 阅读(724) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-02-02 17:55 夜晚的潜水艇 阅读(202) 评论(0) 推荐(0)
摘要: 借助富文本编辑器网站的编辑人员能够像Office一样,写出漂亮的所见即所得的页面。此处以tinymce为例在虚拟环境中安装包pip install django-tinymce 目录: models.py settings.py urls.py admin.py 然后即可在后台实现富文本编辑 阅读全文
posted @ 2020-02-02 17:12 夜晚的潜水艇 阅读(143) 评论(0) 推荐(0)
摘要: phone = '15189827893' list = phone[3:7] new_phone = phone.replace(list, '****') print(new_phone) 阅读全文
posted @ 2020-01-22 21:28 夜晚的潜水艇 阅读(3589) 评论(0) 推荐(0)
摘要: models.py class Candidate(BaseModel): name = models.CharField(max_length=64, verbose_name="候选人姓名", null=True, blank=True) email = models.EmailField(nu 阅读全文
posted @ 2020-01-22 19:01 夜晚的潜水艇 阅读(746) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2020-01-19 15:55 夜晚的潜水艇 阅读(1) 评论(0) 推荐(0)
摘要: settings.py STATIC_URL = '/api/static/' MEDIA_URL = '/api/media/' # MEDIA_ROOT = 'media' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') STATICFILES_DIRS 阅读全文
posted @ 2020-01-19 15:45 夜晚的潜水艇 阅读(412) 评论(0) 推荐(0)
摘要: urls.py url(r'employees/(?P<employee_id>\d+)/detail/', EmployeesViewSet.as_view({'get': 'retrieve'})), views.py class EmployeesViewSet(DestroyModelMix 阅读全文
posted @ 2020-01-19 15:36 夜晚的潜水艇 阅读(826) 评论(0) 推荐(0)
摘要: models.py class Employees(BaseModel): email = models.EmailField( null=True, blank=True, verbose_name='员工邮箱' ) name = models.CharField( max_length=128, 阅读全文
posted @ 2020-01-19 15:31 夜晚的潜水艇 阅读(1115) 评论(0) 推荐(0)
摘要: github 链接:https://github.com/heywbj/django-rest-framework-recursive 无限递归序列化(python默认最大递归层数998)可指定递归层数 serializer.py from rest_framework_recursive.fiel 阅读全文
posted @ 2020-01-13 23:57 夜晚的潜水艇 阅读(1765) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 28 下一页