From: Hongyuan Ma Date: Sun, 3 Jun 2018 12:49:50 +0000 (+0800) Subject: fix url problem X-Git-Url: http://git.postgresql.org/gitweb/static/%7B%7Bpguslink%28?a=commitdiff_plain;h=2477d852722a6099cd9eb3fb0bd542440b2c6c73;p=pgperffarm.git fix url problem --- diff --git a/web/apps/test_records/views.py b/web/apps/test_records/views.py index 361792a..2b40af9 100644 --- a/web/apps/test_records/views.py +++ b/web/apps/test_records/views.py @@ -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) diff --git a/web/pgperffarm/settings.py b/web/pgperffarm/settings.py index dca27c6..bb306d5 100644 --- a/web/pgperffarm/settings.py +++ b/web/pgperffarm/settings.py @@ -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 } diff --git a/web/pgperffarm/urls.py b/web/pgperffarm/urls.py index 1266d61..f63d86f 100644 --- a/web/pgperffarm/urls.py +++ b/web/pgperffarm/urls.py @@ -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),