From 2f1d854a5eb18a673737688ab310036ca0961e04 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Thu, 18 Jun 2020 09:50:09 +0200 Subject: [PATCH] Update project template to make swagger working. --- orchestra/conf/project_template/project_name/settings.py | 4 +++- orchestra/conf/project_template/project_name/urls.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/orchestra/conf/project_template/project_name/settings.py b/orchestra/conf/project_template/project_name/settings.py index 571f8762..88133176 100644 --- a/orchestra/conf/project_template/project_name/settings.py +++ b/orchestra/conf/project_template/project_name/settings.py @@ -67,6 +67,7 @@ INSTALLED_APPS = [ 'rest_framework.authtoken', 'passlib.ext.django', 'django_countries', + 'rest_framework_swagger', # 'debug_toolbar', # Django.contrib @@ -228,7 +229,8 @@ REST_FRAMEWORK = { 'rest_framework.authentication.TokenAuthentication', ), 'DEFAULT_FILTER_BACKENDS': ( - ('rest_framework.filters.DjangoFilterBackend',) + # TODO(@slamora): commented to be able to run rest swagger + #('rest_framework.filters.DjangoFilterBackend',) ), } diff --git a/orchestra/conf/project_template/project_name/urls.py b/orchestra/conf/project_template/project_name/urls.py index 3ae27421..a1a6da8b 100644 --- a/orchestra/conf/project_template/project_name/urls.py +++ b/orchestra/conf/project_template/project_name/urls.py @@ -1,6 +1,11 @@ from django.conf.urls import include, url +from rest_framework_swagger.views import get_swagger_view + + +schema_view = get_swagger_view(title='Orchestra API') urlpatterns = [ + url(r'^swagger/$', schema_view), url(r'', include('orchestra.urls')), ]