随笔分类 - Restframework
摘要:model表: from django.db import models# Create your models here.class UserInfo(models.Model): useranme=models.CharField(max_length=32) password=models.C
阅读全文
摘要:#生成序列化对象class BookModelSerizter(serializers.ModelSerializer): class Meta: model=Book fields='__all__' ##下面相当于是加个连接url,当你访问那个url的时候,就进行反向解析这个url # auth
阅读全文
摘要:url部分: url(r'^book/$',views.book.as_view()),url(r'^books/(\d+)/$', views.bookdetail.as_view(),name='book_detail'), #url(r'^books/(?P<pk>\d+)/$', views
阅读全文