fix url problem
authorHongyuan Ma <CS_MaleicAcid@163.com>
Sun, 3 Jun 2018 12:49:50 +0000 (20:49 +0800)
committerHongyuan Ma <CS_MaleicAcid@163.com>
Sun, 3 Jun 2018 12:49:50 +0000 (20:49 +0800)
web/apps/test_records/views.py
web/pgperffarm/settings.py
web/pgperffarm/urls.py

index 361792a68701c2737bf30fbdde43f08f353e8f3d..2b40af9797f08ec7586129aa1fcb4b9ca743a36c 100644 (file)
@@ -24,6 +24,7 @@ class TestRecordListViewSet(mixins.ListModelMixin, mixins.CreateModelMixin, view
     queryset = TestRecord.objects.all()
     serializer_class = TestRecordSerializer
     pagination_class = StandardResultsSetPagination
+    # authentication_classes = None
     # def get(self, request, *args, **kwargs):
     #     return self.list(request, *args, **kwargs)
 
index dca27c65355d14bec08441124e639a751bb844e0..bb306d5a5a2b3ef57bee06283259128e1b9dee9b 100644 (file)
@@ -122,15 +122,15 @@ AUTH_USER_MODEL = 'users.UserProfile'
 
 REST_FRAMEWORK = {
 
-    'DEFAULT_PERMISSION_CLASSES': (
-        'rest_framework.permissions.IsAuthenticated',
-    ),
-
-    'DEFAULT_AUTHENTICATION_CLASSES': (
-        'rest_framework.authentication.TokenAuthentication',
-        'rest_framework.authentication.BasicAuthentication',
-        'rest_framework.authentication.SessionAuthentication',
-    ),
-
+    'DEFAULT_PERMISSION_CLASSES': (
+        'rest_framework.permissions.IsAuthenticated',
+    ),
+
+    'DEFAULT_AUTHENTICATION_CLASSES': (
+        'rest_framework.authentication.TokenAuthentication',
+        'rest_framework.authentication.BasicAuthentication',
+        'rest_framework.authentication.SessionAuthentication',
+    ),
+    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
     'PAGE_SIZE': 20
 }
index 1266d6138f8cf262ee0030fe274182080ef63476..f63d86f6102a4d5846e4a21280a02d1407b7577d 100644 (file)
@@ -28,7 +28,7 @@ from test_records.views import TestRecordListViewSet
 #     'post': 'create'
 # })
 router = DefaultRouter()
-router.register(r'status', views.TestRecordListViewSet)
+router.register(r'status', TestRecordListViewSet)
 
 urlpatterns = [
     # url(r'^admin/', admin.site.urls),