Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger/redoc added #5

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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