From 5bc1e50f4338cb28d97806bdb147c463d36e4a6c Mon Sep 17 00:00:00 2001 From: mohsentaba Date: Thu, 1 Jan 2026 11:29:58 +0330 Subject: [PATCH] add rest framework configure to production settings. --- config/settings/production.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/config/settings/production.py b/config/settings/production.py index bf90107..698f447 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -67,9 +67,28 @@ CACHES = { # profiles_sample_rate=1.0, # ) -REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = [ +# REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] = [ +# 'rest_framework.renderers.JSONRenderer', +# ] + + +REST_FRAMEWORK = { + 'DEFAULT_PAGINATION_CLASS': 'utils.pagination.StandardResultsSetPagination', + 'PAGE_SIZE': 16, + # 'DEFAULT_AUTHENTICATION_CLASSES': [ + # 'apps.account.auth_back.TokenAuthentication2', + # ], + 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'], + 'DEFAULT_AUTHENTICATION_CLASSES': [ + 'rest_framework.authentication.TokenAuthentication', + # 'rest_framework.authentication.SessionAuthentication', + ], + 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema', + 'EXCEPTION_HANDLER': 'utils.exceptions.exception_handler', + 'DEFAULT_RENDERER_CLASSES':[ 'rest_framework.renderers.JSONRenderer', ] +} LOGGING = {