上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: wget https://raw.githubusercontent.com/nanqinlang-script/acme/master/acme_2.0.sh bash acme_2.0.sh 使用说明 输入你的域名 选择要生成证书的类型。输入数字 0(生成 RSA 类型) 或 1(生成 ECC 阅读全文
posted @ 2023-05-23 14:00 super_ip 阅读(2632) 评论(0) 推荐(0)
摘要: 比如统计某个会员有多少条留言? def follow_num(self): num=Guestbook.objects.filter(user=self.pk,status=True).aggregate(c=Count('user__membername')) return num['c'] 阅读全文
posted @ 2023-05-22 13:51 super_ip 阅读(29) 评论(0) 推荐(0)
摘要: 1.安装drf pip3 install djangorestframework -i https://pypi.douban.com/simple 2.在settings.py的INSTALLED_APPS中添加’rest_framework’。 INSTALLED_APPS = [ ... 'r 阅读全文
posted @ 2023-05-16 21:08 super_ip 阅读(46) 评论(0) 推荐(0)
摘要: 1,先安装npm brew install npm npm init vite-app vue3demmo cd vue3demmo npm install npm run dev 阅读全文
posted @ 2023-05-05 12:44 super_ip 阅读(27) 评论(0) 推荐(0)
摘要: django-admin对搜索结果进行自定义统计,可参考代码如下: def changelist_view(self, request, extra_context=None): #cur1_time = datetime.now() data_dict = {} value = request.G 阅读全文
posted @ 2023-05-05 09:16 super_ip 阅读(187) 评论(0) 推荐(0)
摘要: def full_name(self): return (self.last_name+self.first_name) def __str__(self): return self.full_name() 阅读全文
posted @ 2023-04-29 22:31 super_ip 阅读(47) 评论(0) 推荐(0)
摘要: def true(value) -> bool: return value in ('True', 'true', 'TRUE', True, 1) condition: bool = true(request.GET.get('请求里的字段')) YourModel.objects.filter( 阅读全文
posted @ 2023-04-28 15:41 super_ip 阅读(48) 评论(0) 推荐(0)
摘要: 我想在 django admin 中使用investment字段进行搜索,但总是得到Cannot resolve keyword 'investment' into field.选项是 Model 字段。 有什么方法可以使用investment字段进行搜索? from django.db.model 阅读全文
posted @ 2023-04-25 21:53 super_ip 阅读(72) 评论(0) 推荐(0)
摘要: 根据用户判断权限,显示不同的界面。 class MyModelAdmin(admin.ModelAdmin) def changelist_view(self, request, extra_context=None): user = request.user if user.is_superuse 阅读全文
posted @ 2023-04-24 16:44 super_ip 阅读(66) 评论(0) 推荐(0)
摘要: def is_halfwidth(char): """ 判断一个字符是否是半角 """ if len(char) != len(char.encode()): return False else: return True 阅读全文
posted @ 2023-04-24 14:28 super_ip 阅读(99) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 9 下一页