-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from nens/swagger
swagger/redoc added
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
django == 5.0.1 | ||
psycopg2-binary | ||
djangorestframework | ||
drf-yasg | ||
celery | ||
redis | ||
flower | ||
|