2021-05-26 17:35:21 +02:00
|
|
|
import debug_toolbar
|
|
|
|
from django.conf.urls import include, url
|
2020-12-15 22:33:43 +01:00
|
|
|
from django.contrib import admin
|
2021-05-29 15:34:36 +02:00
|
|
|
from django.urls import path, re_path
|
|
|
|
from drf_yasg import openapi
|
|
|
|
from drf_yasg.views import get_schema_view
|
|
|
|
from rest_framework.permissions import AllowAny
|
|
|
|
|
|
|
|
schema_view = get_schema_view(
|
|
|
|
openapi.Info(title="MediaCMS API", default_version='v1', contact=openapi.Contact(url="https://mediacms.io"), x_logo={"url": "../../static/images/logo_dark.svg"}),
|
|
|
|
public=True,
|
|
|
|
permission_classes=(AllowAny,),
|
|
|
|
)
|
|
|
|
|
2020-12-15 22:33:43 +01:00
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
url(r"^__debug__/", include(debug_toolbar.urls)),
|
|
|
|
url(r"^", include("files.urls")),
|
|
|
|
url(r"^", include("users.urls")),
|
|
|
|
url(r"^accounts/", include("allauth.urls")),
|
|
|
|
url(r"^api-auth/", include("rest_framework.urls")),
|
|
|
|
path("admin/", admin.site.urls),
|
2021-05-29 15:34:36 +02:00
|
|
|
re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
|
|
|
|
re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
|
|
|
|
path('docs/api/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
|
2020-12-15 22:33:43 +01:00
|
|
|
]
|