diff --git a/project/settings.py b/project/settings.py index c78c1fce..4f9fa1d1 100644 --- a/project/settings.py +++ b/project/settings.py @@ -43,6 +43,9 @@ INSTALLED_APPS = [ 'polymorphic_tree', 'polymorphic', 'mptt', + 'rest_framework', + 'rest_framework.authtoken', + 'drf_yasg', ] + [ 'apps.auth.apps', 'apps.user', @@ -171,4 +174,23 @@ TWILIO_ACCOUNT = 'ACdf4a96b776cc764bc3ec0f0e136ba550' TWILIO_TOKEN = '559a6b1fce121759c9af2dcbb3f755ea' TWILIO_FROM_PHONE = '+37128914409' -ACTIVE_LINK_STRICT = True \ No newline at end of file +ACTIVE_LINK_STRICT = True + +# DRF settings + +REST_FRAMEWORK = { + 'DEFAULT_AUTHENTICATION_CLASSES': [ + 'rest_framework.authentication.TokenAuthentication', + 'rest_framework.authentication.SessionAuthentication', + ], + 'DEFAULT_PERMISSION_CLASSES': [ + 'rest_framework.permissions.AllowAny', + ], + 'DEFAULT_FILTER_BACKENDS': ( + 'rest_framework.filters.DjangoFilterBackend', + 'rest_framework.filters.SearchFilter', + 'rest_framework.filters.OrderingFilter', + ), + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', + 'PAGE_SIZE': 10, +}