from django import urls
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url

from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi


schema_view = get_schema_view(
   openapi.Info(
      title="SLAW API",
      default_version='v1',
      description="SLAW: An application designed to recognize exceptional leaders from our various institutions",
      terms_of_service="https://www.google.com/policies/terms/",
      contact=openapi.Contact(email="C360Network@gmail.com"),
      license=openapi.License(name="BSD License"),
   ),
   public=True,
   permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
   # Index
    path('', include('C360N.urls')),

   # Blog
    path('blog/', include('blog.urls')),

    #SLAW API
    path('slaw/api/', include('slaw.urls')),

    #Admin and authentication
    path('admin/', admin.site.urls),
    path('accounts/', include('django.contrib.auth.urls')),

    url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
]
