上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 71 下一页
摘要: Considerations regarding model’s error_messages¶ Error messages defined at the form field level or at the form Meta level always take precedence over 阅读全文
posted @ 2020-10-27 18:18 不带R的墨菲特 阅读(2212) 评论(0) 推荐(0)
摘要: For example, here’s a validator that only allows even numbers: from django.core.exceptions import ValidationError from django.utils.translation import 阅读全文
posted @ 2020-10-27 18:12 不带R的墨菲特 阅读(220) 评论(0) 推荐(0)
摘要: 模型: from django.db import models class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField() def __str__(self): ret 阅读全文
posted @ 2020-10-27 14:37 不带R的墨菲特 阅读(111) 评论(2) 推荐(0)
摘要: LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { # LOGGING FORMAT 'standard': { 'format': '[%(asctime)s] [%(filename)s:%(li 阅读全文
posted @ 2020-10-25 18:10 不带R的墨菲特 阅读(95) 评论(0) 推荐(0)
摘要: from rest_framework.viewsets import ModelViewSet from .serializers import SerializerStudent from rest_framework.response import Response from django.h 阅读全文
posted @ 2020-10-25 17:58 不带R的墨菲特 阅读(145) 评论(0) 推荐(0)
摘要: pip install coreapi 配置settings.py REST_FRAMEWORK={ 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema', } 全局路由配置docs路由: from rest_framework.do 阅读全文
posted @ 2020-10-25 16:47 不带R的墨菲特 阅读(205) 评论(0) 推荐(0)
摘要: 1,有空补上 阅读全文
posted @ 2020-10-25 03:10 不带R的墨菲特 阅读(136) 评论(0) 推荐(0)
摘要: from rest_framework.generics import GenericAPIView from .models import Student,TeacherClass,Teacher,Class from .serializers import SerializerStudent f 阅读全文
posted @ 2020-10-25 01:12 不带R的墨菲特 阅读(316) 评论(0) 推荐(0)
摘要: class SerialierTeacherClass(serializers.ModelSerializer): teacher_ids=serializers.ListField( child=serializers.IntegerField(),allow_empty=False ,write 阅读全文
posted @ 2020-10-24 18:24 不带R的墨菲特 阅读(165) 评论(0) 推荐(0)
摘要: 1.先说才历史问题celery版本支持问题对于3.7以及以上暂时不支持,建议版本3.6,kombu 库里面使用了3.6async 方法名在3.7是内部方法 她。django-redis 要求redis<3.0 ,而celery支持redis版本2.x,所以会冲突,只能卸载django-redis 我 阅读全文
posted @ 2020-10-19 00:25 不带R的墨菲特 阅读(703) 评论(2) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 71 下一页