摘要:        
throttle(访问频率)组件 1.局部视图throttle from rest_framework.throttling import BaseThrottle VISIT_RECORD={} class VisitThrottle(BaseThrottle): def __init__(sel    阅读全文
posted @ 2018-10-07 13:38
G先生
阅读(153)
评论(0)
推荐(0)
        
            
        
        
摘要:        
权限组件 写在开头: 首先要在models表中添加一个用户类型的字段: class User(models.Model): name=models.CharField(max_length=32) pwd=models.CharField(max_length=32) type_choice=((1    阅读全文
posted @ 2018-10-07 12:13
G先生
阅读(446)
评论(0)
推荐(0)
        
            
        
        
摘要:        
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    阅读全文
posted @ 2018-10-07 11:21
G先生
阅读(246)
评论(0)
推荐(0)
        

 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号