From 6352deda3c4cc1ef6a1971f0e51edf1a011be04c Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Sat, 17 Apr 2021 14:57:38 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=9F=D0=BE=D0=B4=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B6=D0=BA=D0=B0=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=BD=D0=B0=20=D1=81=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BE=D0=BD=D0=B5=20Django?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/backend/settings.py | 17 +++++++---------- backend/requirements.txt | 1 + 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/backend/backend/settings.py b/backend/backend/settings.py index 54f089b..56e9dba 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -27,8 +27,8 @@ SECRET_KEY = "django-insecure-toz+*lt(ejm!l*)92w2ciqoh^1kz#a(abbpcn54-dbw(nxoy&7 DEBUG = True ALLOWED_HOSTS = [] -if DEBUG: - ALLOWED_HOSTS = ["0.0.0.0"] +if DEBUG: + ALLOWED_HOSTS = ["0.0.0.0", "localhost", "127.0.0.1"] # Application definition @@ -45,13 +45,7 @@ INSTALLED_APPS = [ ] SWAGGER_SETTINGS = { - 'SECURITY_DEFINITIONS': { - 'Bearer': { - 'type': 'apiKey', - 'name': 'Authorization', - 'in': 'header' - } - } + "SECURITY_DEFINITIONS": {"Bearer": {"type": "apiKey", "name": "Authorization", "in": "header"}} } MIDDLEWARE = [ @@ -130,7 +124,10 @@ SIMPLE_JWT = { } REST_FRAMEWORK = { - "DEFAULT_AUTHENTICATION_CLASSES": ("rest_framework_simplejwt.authentication.JWTAuthentication",) + "DEFAULT_AUTHENTICATION_CLASSES": ( + "rest_framework_simplejwt.authentication.JWTAuthentication", + ), + "DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"], } diff --git a/backend/requirements.txt b/backend/requirements.txt index 733426f..2c9488b 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,4 +1,5 @@ djangorestframework==3.12.4 +django-filter==2.4.0 markdown==3.3.4 appdirs==1.4.4 asgiref==3.3.4