摘要:
throttle(访问频率)组件 1.局部视图throttle from rest_framework.throttling import BaseThrottle VISIT_RECORD={} class VisitThrottle(BaseThrottle): def __init__(sel 阅读全文
摘要:
权限组件 写在开头: 首先要在models表中添加一个用户类型的字段: class User(models.Model): name=models.CharField(max_length=32) pwd=models.CharField(max_length=32) type_choice=((1 阅读全文
摘要:
1. CBV: pass 2 .APIView class BookView(APIView):pass url(r'^books/$', views.BookView.as_view(),name="books"), url(r'^books/$', View类下的view,name="books 阅读全文