Skip to content

Commit

Permalink
Merge pull request #5 from nens/swagger
Browse files Browse the repository at this point in the history
swagger/redoc added
  • Loading branch information
JJFlorian authored Mar 18, 2024
2 parents 1817de6 + bf2178f commit c170fc6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions bro_hub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"drf_yasg",
"django_filters",
"rest_framework_simplejwt",
"encrypted_model_fields",
Expand Down
22 changes: 22 additions & 0 deletions bro_hub/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,37 @@

from django.contrib import admin
from django.urls import include, path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
)

from api import views

schema_view = get_schema_view(
openapi.Info(
title="BROHub API",
default_version="v1",
description="Simplify the data management of the BRO",
terms_of_service="",
contact=openapi.Contact(email="[email protected]"),
license=openapi.License(name="BSD License"),
),
public=True,
permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
path("admin/", admin.site.urls),
path(
"swagger/",
schema_view.with_ui("swagger", cache_timeout=0),
name="schema-swagger-ui",
),
path("redoc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"),
path("api/", include(("api.urls", "api"), namespace="api")),
path("api/token/", TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
django == 5.0.1
psycopg2-binary
djangorestframework
drf-yasg
celery
redis
flower
Expand Down

0 comments on commit c170fc6

Please sign in to comment.