摘要:
```from django.conf.urls import urlfrom django.views.static import servefrom project01.settings import MEDIA_ROOT from . import views urlpatterns = [ url(r'^media/(?P.*)$', serve, {"document_root",... 阅读全文
摘要:
``` from django.db import models # 汽车表、汽车商家表、赞助商表、赞助商详情表 class BaseModel(models.Model): is_delete = models.BooleanField(default=False) createdTime = models.DateTimeField(auto_now_add=True) class Meta: 阅读全文
摘要:
``` from rest_framework import serializers from . import models class CarModelSerializer(serializers.ModelSerializer): re_brand = serializers.CharField(write_only=True) class Meta: model = models.Car 阅读全文
摘要:
Serializer序列化(了解) 视图类 序列化类 Serializer反序列化(了解) 视图类 序列化类 阅读全文