Ejemplo n.º 1
0
from bothub.api.v2.swagger import CustomOpenAPISchemaGenerator
from bothub.health.views import ping
from bothub.health.views import r200
from bothub.common.views import download_bot_data
from bothub.api.grpc.user.handlers import grpc_handlers as grpc_authentication_handlers
from bothub.api.grpc.organization.handlers import grpc_handlers as grpc_common_handlers
from bothub.api.grpc.repository.handlers import (
    grpc_handlers as grpc_repository_handlers, )

schema_view = get_schema_view(
    openapi.Info(
        title="API Documentation",
        default_version="v2.1.29",
        description="Documentation",
        terms_of_service="https://bothub.it/terms",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="GPL-3.0"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
    generator_class=CustomOpenAPISchemaGenerator,
)

urlpatterns = [
    path("", schema_view.with_ui("redoc")),
    path("v2/", include(bothub_api_v2_urls)),
    path("admin/", admin.site.urls),
    path("ping/", ping, name="ping"),
    path("200/", r200, name="200"),
    path("downloadbotdata/<int:update_id>/",
         download_bot_data,
Ejemplo n.º 2
0
]

# static path
# urlpatterns += [static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)]

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="2020ELK API",
        default_version='v1',
        description="systex B85B project",
        # terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        # license=openapi.License(name="BSD License"),
    ),
    # public=True,
    # patterns=[url(r"^api/", include((es_urls, 'api'), namespace='v1'))],
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns += [
    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'),
]
Ejemplo n.º 3
0
from django.conf import settings
from django.conf.urls.static import static
from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi
from django.views.generic.base import RedirectView

admin.site.site_header = "OfferYangu Admin"
admin.site.site_title = "OfferYangu Admin Portal"
admin.site.index_title = "Welcome to OfferYangu Admin Portal"

schema_view = get_schema_view(
    openapi.Info(
        title="Offer Yangu API",
        default_version='v1',
        description="The official Offer Yangu API documentation",
        license=openapi.License(name="BSD License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

admin.site.site_url = 'https://development.offeryangu.co.ke/' 

urlpatterns = [
    path('',  RedirectView.as_view(url='docs')),
    re_path(r'^docs(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    path('docs', 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('admin/', admin.site.urls),
Ejemplo n.º 4
0
"""
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.urls import include, path
from drf_yasg2 import openapi
from drf_yasg2.views import get_schema_view

from ZhiQue import permissions
from oauth.views import LoginView, AuthorizeView, LogoutView, OAuthLoginView

schema_view = get_schema_view(
    openapi.Info(
        title='知雀',
        default_version='v1',
        description='知雀接口文档',
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path('swagger-ui/',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
    url(r'^(?P<version>(v1|v2))/account/',
        include('account.urls', namespace='account')),
    url(r'^(?P<version>(v1|v2))/oauth/',
        include('oauth.urls', namespace='oauth')),
    url(r'^(?P<version>(v1|v2))/yuque/',
        include('yuque.urls', namespace='yuque')),
Ejemplo n.º 5
0
ur += component_urls
ur += regulations

swagger_urls = [
    url(r'^$', SwaggerView.as_view(), name='index'),
    url(r'^resources/$', ResourcesView.as_view(), name='resources'),
    url(r'^schema/(?P<resource>\S+)$', SchemaView.as_view()),
    url(r'^schema/$', SchemaView.as_view(), name='schema'),
]

schema_view = get_schema_view(
    openapi.Info(
        title="Defect Dojo API",
        default_version='v2',
        description="To use the API you need be authorized.",
    ),
    # if public=False, includes only endpoints the current user has access to
    public=True,
    # The API of a OpenSource project should be public accessible
    permission_classes=[permissions.AllowAny],
)

urlpatterns = [
    # These are the SAML2 related URLs. You can change "^saml2_auth/" regex to
    # any path you want, like "^sso_auth/", "^sso_login/", etc. (required)
    url(r'^saml2/', include('django_saml2_auth.urls')),
    # The following line will replace the default user login with SAML2 (optional)
    # If you want to specific the after-login-redirect-URL, use parameter "?next=/the/path/you/want"
    # with this view.
    url(r'^saml2/login/$', django_saml2_auth.views.signin),
    #  tastypie api
Ejemplo n.º 6
0
    title="Snippets API",
    default_version="v1",
    description="""This is a demo project for the [drf_yasg2](https://github.com/joellefkowitz/drf-yasg) Django Rest Framework library.

The `swagger-ui` view can be found [here](/cached/swagger).
The `ReDoc` view can be found [here](/cached/redoc).
The swagger YAML document can be found [here](/cached/swagger.yaml).

You can log in using the pre-existing `admin` user with password `passwordadmin`.""",  # noqa
    terms_of_service="https://www.google.com/policies/terms/",
    contact=openapi.Contact(email="*****@*****.**"),
    license=openapi.License(name="BSD License"),
)

SchemaView = get_schema_view(
    validators=["ssv", "flex"], public=True, permission_classes=(permissions.AllowAny,),
)


@api_view(["GET"])
def plain_view(request):
    pass


def root_redirect(request):
    user_agent_string = request.META.get("HTTP_USER_AGENT", "")
    user_agent = user_agents.parse(user_agent_string)

    if user_agent.is_mobile:
        schema_view = "cschema-redoc"
    else:
Ejemplo n.º 7
0
"""
from django.contrib import admin
from django.urls import path, include
from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi

admin.site.site_header = 'IIT BHU Workshops App Backend Administration'

schema_view = get_schema_view(
    openapi.Info(
        title="IIT BHU Workshops App API",
        default_version='v1',
        description="""
This is the official IIT BHU Workshops App API developed using Django Rest Framework.

The source code can be found [here](https://github.com/IIT-BHU-InstiApp/lite-hai-backend).
        """,
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
    path('', include('authentication.urls')),
    path('', include('config.urls')),
    path('', include('workshop.urls')),
Ejemplo n.º 8
0
from django.conf.urls import include, url
from rest_framework import permissions

import testproj.urls
from drf_yasg2 import openapi
from drf_yasg2.views import get_schema_view

view = get_schema_view(openapi.Info("bla", "ble"),
                       public=False,
                       permission_classes=(permissions.AllowAny, ))
view = view.without_ui(cache_timeout=None)

urlpatterns = [
    url(r"^", include(testproj.urls)),
    url(r"^private/swagger.yaml", view, name="schema-private"),
]
"""
from django.contrib import admin
from django.urls import path,include
from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi
from django.conf import settings
from django.conf.urls.static import static


schema_view = get_schema_view(
   openapi.Info(
      title="PDF extract API",
      default_version='v1',
      description="extract pdf",
      terms_of_service="https://www.google.com/policies/terms/",
      contact=openapi.Contact(email="*****@*****.**"),
      license=openapi.License(name="MIT License"),
   ),
   public=True,
   permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/api-auth/', include('rest_framework.urls')),
    path('api/v1/', include('account_app.urls')),
    path('api/v1/', include('pdf_app.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'),
]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Ejemplo n.º 10
0
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
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="Users API",
        default_version='v1',
        description="Resp api of users.json",
        contact=openapi.Contact(email="*****@*****.**"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include("user_api.urls")),
    path('api/doc',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
]
Ejemplo n.º 11
0
description = ''
with open(configuration['DESCRIPTION_PATH'], 'r') as f:
    description = f.read()

contact = configuration.get('CONTACT', None)
logo = configuration.get('LOGO', None)

# Used to generate the Swagger / ReDoc documentation automatically
SchemaView = get_schema_view(
    openapi.Info(
        title=configuration['TITLE'],
        default_version=configuration['VERSION'],
        description=description,
        contact=None if not contact else (
            openapi.Contact(
                name=contact['NAME'],
                email=contact['EMAIL']
            )
        ),
        x_logo=None if not logo else {
            'url': logo['SRC'],
            'backgroundColor': '#fafafa',
            'altText': configuration['TITLE'],
            'href': logo['URL'],
        }
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)
Ejemplo n.º 12
0
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from drf_yasg2 import openapi
from drf_yasg2.views import SwaggerUIRenderer, get_schema_view
from rest_framework.permissions import AllowAny
from main.views import survey, webhook

SwaggerUIRenderer.template = 'swagger-ui.html'

schema_view = get_schema_view(
   openapi.Info(
      title="ESH Survey API",
      default_version='v1',
      description="Backend as a Service (BaaS) for ESH Survey",
   	  contact=openapi.Contact(email="*****@*****.**"),
   ),
   public=True,
   permission_classes=(AllowAny,),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('<int:survey_id>/<str:uuid>', survey, name='survey'),
    path('webhook', webhook, name="webhook"),
    path('', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]
Ejemplo n.º 13
0
from django.urls import path, include
from rest_framework import routers
from crecheapp import api
from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi
from . import views
from .myviews import contact, login

schema_view = get_schema_view(
    openapi.Info(
        title="API Crèche",
        default_version='v1',
        description="Documentation de l'API du projet Crèche",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="BSD License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

rooter = routers.DefaultRouter()

rooter.register('blog', api.BlogViewSet, basename='blog')
rooter.register('galerie', api.GaleriesViewSet, basename='galerie')
rooter.register('utilisateur', api.UtilisateurViewSet, basename='utilisateur')
rooter.register('parent', api.ParentViewSet, basename='parent')
rooter.register('enfant', api.EnfantViewSet, basename='enfant')
rooter.register('groupe', api.GroupeViewSet, basename='groupe')
rooter.register('album', api.AlbumViewSet, basename='album')
Ejemplo n.º 14
0
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import path, include
from drf_yasg2 import openapi
from drf_yasg2.views import get_schema_view
from rest_framework import permissions

from connect.api.v1 import urls as rookly_api_v1_urls
from connect.api.grpc.project.handlers import grpc_handlers as grpc_project_handlers
from connect.api.grpc.organization.handlers import grpc_handlers as grpc_organization_handlers
from connect.billing.views import StripeHandler

schema_view = get_schema_view(
    openapi.Info(
        title="API Documentation",
        default_version="v1.0.12",
        license=openapi.License(name="GPL-3.0 License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path("", schema_view.with_ui("redoc")),
    path("admin/", admin.site.urls),
    path("v1/", include(rookly_api_v1_urls)),
    url(r"^handlers/stripe/$",
        StripeHandler.as_view(),
        name="handlers.stripe_handler"),
]

urlpatterns += staticfiles_urlpatterns()
Ejemplo n.º 15
0
from django.contrib import admin
from django.urls import path, include
from drf_yasg2 import openapi
from drf_yasg2.views import get_schema_view
from rest_framework import routers, permissions
from rest_framework.authtoken import views

import praggregator.views
from app.views import ProductViewSet, OfferViewSet

schema_view = get_schema_view(
    openapi.Info(
        title="Product Aggregator API",
        default_version='v1',
        description="Let this be the ultimate source of the Product aggregator knowledge. Use it wisely and if "
                    "anything is wrong, contact the developer.",
        contact=openapi.Contact(email="*****@*****.**"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

router = routers.DefaultRouter()
router.register(r'products', ProductViewSet)
router.register(r'offers', OfferViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('signup/', praggregator.views.signup, name='signup'),
    path('api/v1/', include(router.urls)),
    path('api/v1/auth/', views.obtain_auth_token, name='auth'),
Ejemplo n.º 16
0
Archivo: urls.py Proyecto: DumData/GBEX
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi

from decorator_include import decorator_include

from GBEX_app.drf import GBEX_API_ViewSets
from GBEX_bigfiles.views import download_file

router = routers.DefaultRouter()
for name, viewset in GBEX_API_ViewSets:
	router.register(name, viewset)

schema_view = get_schema_view(
	openapi.Info(
		title="GBEX API",
		default_version="v1"
	),
	public=False,
	permission_classes=(permissions.IsAuthenticated,),
)

# generally views that are used to log the user in or has its own authentication machinery needs to be here
urlpatterns = [
	re_path('swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
	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('resumable_upload', include('GBEX_bigfiles.urls')),
	path('admin/', admin.site.urls),
	path('accounts/', include('django.contrib.auth.urls')),
	path('api/', include(router.urls)),
	path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
	path('downloads/<model>/<inst_name>/<filename>', download_file, name='download_url'),
Ejemplo n.º 17
0
from drf_yasg2.views import get_schema_view
from rest_framework import routers, permissions, authentication

from environments.identities.traits.views import SDKTraits
from environments.identities.views import SDKIdentities
from features.views import SDKFeatureStates
from organisations.views import chargebee_webhook
from segments.views import SDKSegments
from analytics.views import SDKAnalyticsFlags

schema_view = get_schema_view(
    openapi.Info(
        title="Flagsmith API",
        default_version="v1",
        description="",
        license=openapi.License(name="BSD License"),
        contact=openapi.Contact(email="*****@*****.**"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
    authentication_classes=(authentication.SessionAuthentication, ),
)

traits_router = routers.DefaultRouter()
traits_router.register(r"", SDKTraits, basename="sdk-traits")

app_name = "v1"

urlpatterns = [
    url(r"^organisations/",
        include("organisations.urls"),
        name="organisations"),
Ejemplo n.º 18
0
from django.contrib import admin
from django.urls import path, include, re_path
from . import utils

# Swagger
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="Coupon Portal API docs.",
        default_version='v1',
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('auth/', include('dj_rest_auth.urls')),
    path('auth/registration/', include('dj_rest_auth.registration.urls')),

    path('users/', include("users.urls")),
    path('orders/', include("orders.urls")),
    path('coupons/', include("coupons.urls")),

    path('send-vpn-mail/', utils.send_vpn_mail),

    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'),
Ejemplo n.º 19
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from drf_yasg2 import openapi
from drf_yasg2.views import get_schema_view
from rest_framework import permissions

schema_view = get_schema_view(
    openapi.Info(title='musicians_site API',
                 default_version='v1',
                 description='Description',
                 contact=openapi.Contact(email='*****@*****.**'),
                 license=openapi.License(name='BSD License')),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include('lessons.urls')),
    path('auth/', include('authentication.urls')),
    path('static-content/', include('static_content.urls')),
    url(r'^docs/$',
        schema_view.with_ui('swagger', cache_timeout=0),
        name='schema-swagger-ui'),
]
Ejemplo n.º 20
0
    path("accounts/", include("allauth.urls")),
    path("upload/", include("django_file_form.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()

# API URLS
urlpatterns += [
    path("api/", include("config.api_router")),
    path("auth-token/", obtain_auth_token),
]

# SWAGGER
schema_view = get_schema_view(
    openapi.Info(title="Orochi API", default_version="v1"),
    public=True,
    permission_classes=(permissions.AllowAny,),
)
urlpatterns += [
    re_path(
        r"^swagger(?P<format>\.json)$",
        schema_view.without_ui(cache_timeout=0),
        name="schema-json",
    ),
    path(
        r"swagger/",
        schema_view.with_ui("swagger", cache_timeout=0),
        name="schema-swagger-ui",
    ),
    path(r"redoc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"),
]
Ejemplo n.º 21
0
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path, re_path, include
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="Tweet API",
        default_version='v1',
        description="Welcome to the world of Tweet",
        terms_of_service="https://www.tweet.org",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="Awesome IP"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    re_path(r'^doc(?P<format>\.json|\.yaml)$',
            schema_view.without_ui(cache_timeout=0),
            name='schema-json'),
    path('doc/',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
    path('redoc/',
         schema_view.with_ui('redoc', cache_timeout=0),
Ejemplo n.º 22
0

class IsAdminOrDebug(BasePermission):
    def has_object_permission(self, request, view, obj):
        # allow swagger access to anybody in DEBUG mode
        # and only to the admin in all other cases
        user = request.user
        return user.is_superuser or settings.DEBUG


API_SCHEMA_TILE = f"{getattr(settings, 'PROJECT_NAME', 'Django-Astrosat')} API"

api_schema_view = get_schema_view(
    openapi.Info(
        title=API_SCHEMA_TILE,
        default_version="v1",  # url=Site.objects.get_current().domain,
    ),
    public=True,
    permission_classes=(IsAdminOrDebug, ),
)

api_schema_views = [
    re_path(
        r"^swagger(?P<format>\.json|\.yaml)$",
        api_schema_view.without_ui(cache_timeout=0),
        name="swagger-json",
    ),
    re_path(
        r"^swagger/$",
        api_schema_view.with_ui("swagger", cache_timeout=0),
        name="swagger",
    ),
Ejemplo n.º 23
0
from backend.usage.views import ReportViewSet, StationViewSet, AgentSubmit, AgentReportQuery, AgentStationQuery, EmailReportView, AgentResubmit
from backend.users.views import UserInfoViewSet, UserViewSet, ChangePassword, ChangeUserInfo
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi

router = routers.DefaultRouter()
router.register("station", StationViewSet, basename="station")
router.register("usage", ReportViewSet, basename="usage")
router.register("userinfo", UserInfoViewSet, basename="userinfo")
router.register("user", UserViewSet, basename="user")

schema_view = get_schema_view(
    openapi.Info(
        title="ibiblio Radiostats Backend API",
        default_version='v1',
        contact=openapi.Contact(email="*****@*****.**"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path('api/user/change_password/',
         ChangePassword.as_view(),
         name='change_password'),
    path('api/user/change_userinfo/',
         ChangeUserInfo.as_view(),
         name='change_userinfo'),
    path('api/usage/agent/submit/', AgentSubmit.as_view(),
         name='agent_submit'),
    path('api/usage/agent/submit/<int:pk>/',
Ejemplo n.º 24
0
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls.conf import include
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi

#SWAGGER schema
schema_view = get_schema_view(
    openapi.Info(
        title="Mantis CRM company API",
        default_version='v1',
        description="CRM company node of MANTIS core project",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="BSD License"),
    ),
    public=True,
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/doc',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
    path('api/v1/company/', include('company.urls')),
    #path('api/v1/finance', include('finance.urls'))
]
Ejemplo n.º 25
0
from drf_yasg2 import openapi
from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
)


schema_view = get_schema_view(
      openapi.Info(
         title="SuperBol API",
         default_version='v1',
         description="Documentacao",
         terms_of_service="https://www.google.com/policies/terms/",
         contact=openapi.Contact(email="*****@*****.**"),
         license=openapi.License(name="BSD License"),
      ),
      public=True,
      permission_classes=(permissions.AllowAny,),
   )

router = routers.SimpleRouter()
router.register(r'api/gerente', GerenteViewSet)
router.register(r'api/administrador',  AdministradorViewSet)
router.register(r'api/banca', BancaViewSet)
router.register(r'api/cambista', CambistaViewSet)
router.register(r'api/config', ConfigViewSet)
router.register(r'api/cliente', ClienteViewSet)
router.register(r'api/plano', PlanoViewSet)
router.register(r'api/contaspg', ContaPgViewSet)
Ejemplo n.º 26
0
from rest_framework_simplejwt import views as jwt_views
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
)

from users.views import UserViewSet
from app.views import AppViewSet

schema_view = get_schema_view(
    openapi.Info(
        title="Digidex portail API",
        default_version='v1',
        description="This APi have been made for Digidex design",
        contact=openapi.Contact(email="doumbialassane10@@gmail.com"),
        license=openapi.License(name="Personal License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

# Create a router and register our viewsets with it.
router = DefaultRouter()
#router.register(r'apps', AppList)
router.register(r'users', UserViewSet)
#router.register(r'app', AppViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path(
Ejemplo n.º 27
0
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi

# Open api schema
schema_view = get_schema_view(
    openapi.Info(
        title="Scouts verzekeringen API",
        default_version="v1",
        description=
        "This is the api documentation for the Scouts verzekeringen API",
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path("api/", include("apps.insurances.urls")),
    path("api/", include("apps.members.urls")),
    path("api/", include("apps.equipment.urls")),
    path("api/", include("apps.locations.urls")),
    path("api/", include("apps.info.urls")),
    path("api/auth/", include("apps.scouts_auth.urls")),
    path("api/oidc/", include("apps.oidc.urls")),
    path("swagger/",
         schema_view.with_ui("swagger", cache_timeout=0),
Ejemplo n.º 28
0
from django.urls import path, re_path

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

from api.v1.mailing.viewsets import SubscriberViewSet, MailHistoryViewSet

schema_view = get_schema_view(
    openapi.Info(
        title="헤렌 코딩 테스트",
        default_version="v1",
        description="헤렌 코딩 테스트 API 문서입니다 ㅎ-ㅎ",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="BSD License"),
    ),
    public=True,
    permission_classes=(permissions.IsAdminUser, ),
)

urlpatterns = [
    path("/subscribe",
         SubscriberViewSet.as_view({"post": "create"}),
         name="subscribe"),
    path(
        "/unsubscribe",
        SubscriberViewSet.as_view({"post": "unsubscribe"}),
        name="unsubscribe",
    ),
    path(
Ejemplo n.º 29
0
from django.urls import path, include, re_path
from rest_framework.authtoken.views import obtain_auth_token

from rest_framework import permissions
from drf_yasg2.views import get_schema_view
from drf_yasg2 import openapi
from django.conf.urls.static import static
from django.views.static import serve
from django.conf import settings

schema_view = get_schema_view(
    openapi.Info(
        title="Arthub API",
        default_version="v1",
        description="Application Interface",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="MIT License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path("admin/", admin.site.urls),
    re_path(
        r"^swagger(?P<format>\.json|\.yaml)$",
        schema_view.without_ui(cache_timeout=0),
        name="schema-json",
    ),
    re_path(
        r"^swagger/$",
Ejemplo n.º 30
0
    path(f'api-token-auth/', authtoken_view.obtain_auth_token),
]

# 接口文档 仅调试模式可用
if settings.DEBUG:
    openapi_obj = openapi.Info(
        title="项目名称",
        default_version='v1',
        description="说明",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="BSD License"),
    )
    schema_view = get_schema_view(
        openapi_obj,
        public=True,
        # permission_classes=(permissions.AllowAny,),
        permission_classes=(permissions.IsAdminUser, ),
    )
    urlpatterns.extend([
        # AutoScheme接口文档
        path(f'api-docs/auto/', include_docs_urls(title=openapi_obj.title)),
        # Swagger文档
        path(f'api-docs/swagger/',
             schema_view.with_ui('swagger', cache_timeout=0)),
        path(f'api-docs/swagger<str:format>',
             schema_view.without_ui(cache_timeout=0),
             name='schema-json'),
        # redoc文档
        path(f'api-docs/redoc/', schema_view.with_ui('redoc', cache_timeout=0))
    ])