Example #1
0
from django.urls import path
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="JetLend API",
        default_version='v1',
        description="Simple API Documentation",
        license=openapi.License(name="Some License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    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'),
]
from django.urls import include, path
from django.contrib import admin
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="Workalove Challenge",
        default_version='v1',
        description="Builded by Emerson Guedes",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(
            name="Todos os direitos reservados: Emerson Guedes de Oliveira"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path("v1/user/", include("user.urls", namespace='api-user')),
    path("v1/recipe/", include("recipe.urls", namespace='api-recipe')),
    path("admin/", admin.site.urls),
    path("",
         schema_view.with_ui('redoc', cache_timeout=0),
         name='schema-redoc'),
]
Example #3
0
from django.urls import path, include

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

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

urlpatterns = [
    # Swagger
    path('',
         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'),

    # Admin
Example #4
0
from drf_yasg import openapi

from api.v2.views import misc, rest, search
from api.v2.utils import get_stats, clear_stats

app_name = "api_v2"

API_METADATA = settings.API_METADATA
schema_view = get_schema_view(
    openapi.Info(
        title=API_METADATA["title"],
        description=API_METADATA["description"],
        default_version="v2",
        terms_of_service=API_METADATA["terms"]["url"],
        contact=openapi.Contact(**API_METADATA["contact"]),
        license=openapi.License(**API_METADATA["license"]),
    ),
    # url="{}/api".format(settings.APPLICATION_URL),
    validators=["flex", "ssv"],
    public=True,
    permission_classes=(AllowAny, ),
)

router = SimpleRouter(trailing_slash=False)

router.register(r"issuer", rest.IssuerViewSet)
router.register(r"schema", rest.SchemaViewSet)
router.register(r"credentialtype", rest.CredentialTypeViewSet)
router.register(r"credential", rest.CredentialViewSet)
router.register(r"topic", rest.TopicViewSet)
router.register(r"topic_relationship", rest.TopicRelationshipViewSet)
Example #5
0
"""Represents URL endpoints for an application."""
from typing import Any, List
from django.urls import include, path
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from .views import QuoteDetail, Quotes

urlpatterns: List[Any] = [
    path("", Quotes.as_view()),
    path("<int:pk>", QuoteDetail.as_view()),
    path("api-auth/", include("rest_framework.urls")),
    path(
        "docs/",
        get_schema_view(
            openapi.Info(
                title="Quotes REST API",
                default_version="v1",
                description="Swagger documentation for Quotes REST API",
                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, ),
        ).with_ui("swagger", cache_timeout=0),
        name="schema-swagger-ui",
    ),
]
Example #6
0
from openapi.views.upload_view import UploadView
from openapi.views.user_view import ListUsersView
from openapi.views.user_view import UserInfoView
from openapi.views.user_view import UserTeamInfoView
from openapi.views.apps.apps import ListAppsView, AppInfoView
from openapi.views.apps.market import MarketAppInstallView
from openapi.views.gateway.gateway import ListAppGatewayHTTPRuleView

schema_view = get_schema_view(
    openapi.Info(
        title="Rainbond Open API",
        default_version='v1',
        description="Rainbond open api",
        terms_of_service="https://www.rainbond.com",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="LGPL License"),
    ),
    public=False,
    permission_classes=(OpenAPIPermissions, ),
    authentication_classes=(OpenAPIAuthentication, ),
)

urlpatterns = [
    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),
Example #7
0
from django.contrib import admin
from django.urls import path, include
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi



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




urlpatterns = [
    path('admin/', admin.site.urls),
    path('auth/',include('authentication.urls')),
    path('expenes/',include('expenses.urls')),
    path('income/',include('Income.urls')),
    path('', 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'),
Example #8
0
from django.conf.urls import url
from django.urls import path, include
from rest_framework.permissions import AllowAny, IsAuthenticated, BasePermission
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_url_patterns = [
    path('api/', include('api.urls')),
]

schema_view = get_schema_view(
    openapi.Info(
        title="DRF API Documents",
        default_version='v1',
        description="DjangoRestFramework API Server",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="ParkHyeonChae"),
    ),
    validators=['flex'],
    public=True,
    permission_classes=(AllowAny, ),
    patterns=schema_url_patterns,
)
Example #9
0
admin.site.site_header = "Purplship"
admin.site.site_title = "Purplphip shipping API"
admin.site.index_title = "Administration"

schema_view = get_schema_view(
    openapi.Info(
        title="Purplship Open Source Multi-carrier Shipping API",
        default_version=f'v1-{settings.VERSION}',
        description=("""
      Purplship is an open source multi-carrier shipping API that simplifies the integration of logistic carrier services

      The **proxy** endpoints are stateless and forwards calls to carriers web services.
      """),
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="AGPLv3+ License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path(settings.OPEN_API_PATH,
         schema_view.with_ui('redoc', cache_timeout=0),
         name='schema-redoc'),
    path('swagger<str:format>',
         schema_view.without_ui(cache_timeout=0),
         name='schema-json'),
    path('admin/', admin.site.urls, name='app_admin'),
    path('api-auth/', include('rest_framework.urls',
                              namespace='rest_framework')),
Example #10
0
from django.conf.urls import url
from website import views
from rest_framework import routers, serializers, viewsets
from django.views.generic.base import TemplateView, RedirectView

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

schema_view = get_schema_view(
    openapi.Info(
        title="SWStats Public API",
        default_version='v0.1',
        description="Summoners War Statistics Web Public API",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="Apache 2.0"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

router = routers.DefaultRouter()
router.register(r'upload', views.UploadViewSet, 'upload')
router.register(r'command', views.CommandViewSet, 'command')

# PUBLIC API
router.register(r'monsters', views.MonsterViewSet, 'monsters')
router.register(r'runes', views.RuneViewSet, 'runes')
router.register(r'artifacts', views.ArtifactViewSet, 'artifacts')

# upload theoritically CONST data only if DEBUG mode is enabled ( i.e. when in need to update whole Database )
Example #11
0
                basename="scan_commands")
router.register(r"scans", views.ScanViewSet, basename="scans")
router.register(r"scheduled_scans",
                views.ScheduledScanViewSet,
                basename="scheduled_scans")
router.register(r"sites", views.SiteViewSet, basename="sites")

schema_view = get_schema_view(
    openapi.Info(
        title="Scantron API",
        default_version="v1",
        description="Scantron API documentation",
        terms_of_service="https://github.com/rackerlabs/scantron",
        contact=openapi.Contact(
            email="https://github.com/rackerlabs/scantron"),
        license=openapi.License(name="Apache License, Version 2.0"),
    ),
    public=False,
    permission_classes=(
        permissions.IsAuthenticated, ),  # comma needed inside parenthesis.
)

urlpatterns = [
    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),
Example #12
0
from django.urls import path, re_path
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="Simple Social Network API",
        default_version='v1',
        description="Test description",
        terms_of_service="https://www.google.com/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="Licence Type"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

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'),
]
Example #13
0
from django.urls import path
from . import views
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        # 필수인자
        title="Music API",
        default_version="v1",
        # 선택인자
        description="음악관련 API 서비스입니다.",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="SSAFY License"),
    ))

app_name = 'musics'

urlpatterns = [
    path('musics/', views.music_list, name='music_list'),
    path('musics/<int:music_pk>/', views.music_detail, name='music_detail'),
    path('musics/<int:music_pk>/comments/',
         views.comments_create,
         name='comments_create'),
    path('comments/<int:comment_pk>/',
         views.comments_update_and_delete,
         name='comments_create_and_delete'),
    path('artists/', views.artist_list, name='artist_list'),
    path('artists/<int:artist_pk>/', views.artist_detail,
         name='artist_detail'),
Example #14
0
from graphene_django.views import GraphQLView



# drf_yasg code starts here
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_view(
    openapi.Info(
        title="franck API",
        default_version='v1',
        description="Bienvenu sur mon api",
        terms_of_service="https://www.jaseci.org",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="Awesome IP"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

urlpatterns = [


    path('tinymce/', include('tinymce.urls')),

    path('admin/filebrowser/', site.urls),

    path('admin/', admin.site.urls),

Example #15
0
from django.contrib import admin
from django.urls import path, include
from django.views.generic.base import TemplateView
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi


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

urlpatterns = [
    path('swagger/yaml/',
         schema_view.without_ui(cache_timeout=0),
         name='schema-yaml'),
    path('swagger/',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
    path('admin/', admin.site.urls),
    path('', include('transactions.urls')),
    path('accounts/', include('accounts.urls')),
Example #16
0
from django.contrib import admin
from django.urls import path, include
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="Blog API",
        default_version="v2",
        description="Our first Blog REST API",
        license=openapi.License(name='GPL-3.0'),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    # Django admin
    path('admin/', admin.site.urls),

    # API version 1
    path('api/v1/', include('api.urls')),
    path('api/v1/auth/', include('dj_rest_auth.urls')),
    path('api/v1/auth/registration/',
         include('dj_rest_auth.registration.urls')),

    # API version 2
    path('api/v2/', include('apiv2.urls')),
    path('api/v2/auth/', include('dj_rest_auth.urls')),
    path('api/v2/auth/registration/',
Example #17
0
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework_jwt.views import refresh_jwt_token
from rest_framework_jwt.views import verify_jwt_token
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from rest_auth.registration.views import VerifyEmailView, RegisterView

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


def trigger_error(request):
    division_by_zero = 1 / 0


urlpatterns = [
    re_path(r'^swagger(?P<format>\.json|\.yaml)$',
            schema_view.without_ui(cache_timeout=0),
            name='schema-json'),
    re_path(r'^swagger/$',
Example #18
0
* Zaken API *(optioneel)*
* Documenten API *(optioneel)*

**Autorisatie**

Deze API vereist autorisatie. Je kan de
[token-tool](https://zaken-auth.vng.cloud/) gebruiken om JWT-tokens te
genereren.

**Notificaties**

{notification_documentation(KANAAL_VERZOEKEN)}

**Handige links**

* [Documentatie](https://zaakgerichtwerken.vng.cloud/standaard)
* [Zaakgericht werken](https://zaakgerichtwerken.vng.cloud)
"""

info = openapi.Info(
    title=f"{settings.PROJECT_NAME} API",
    default_version=settings.API_VERSION,
    description=description,
    contact=openapi.Contact(
        email="*****@*****.**",
        url="https://zaakgerichtwerken.vng.cloud",
    ),
    license=openapi.License(name="EUPL 1.2",
                            url="https://opensource.org/licenses/EUPL-1.2"),
)
Example #19
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.urls import path, include
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions

schema_view = get_schema_view(
    openapi.Info(
        title="Agriness Test API",
        default_version='v1',
        description="Agriness Technical Challenge",
        terms_of_service="No Terms",
        license=openapi.License(name="No License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
    path('admin/', admin.site.urls),

    # docs
    url(r'^docs(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    url(r'^docs/$', 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'),

    path('api/', include('apps.books.urls', namespace='books')),
    path('api/', include('apps.clients.urls', namespace='clients')),
Example #20
0
from django.urls import path, include
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from rest_framework import routers


router = routers.DefaultRouter()

schema_view = get_schema_view(
    openapi.Info(
        title="julius_app API",
        default_version='v1',
        description="API julius_app",
        terms_of_service="https://terms.julius_app.com",
        contact=openapi.Contact(email="contact@julius_app.com"),
        license=openapi.License(name="Copyright"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)


urlpatterns = [
    path('', include(router.urls)),
    path('', include('julius_app.apps.accounts.urls')),
    path('admin/', admin.site.urls),
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('swagger-ui/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]
Example #21
0
    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_yasg.views import get_schema_view
from drf_yasg import openapi

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

urlpatterns = [
    path('auth/', include('rest_framework.urls')),
    path('admin/', admin.site.urls),
    path('', include('accounts.urls')),
    path('', include('blog.urls')),
    path('', include('groups.urls')),
    path('', include('profiles.urls')),
    path('', include('pages.urls')),
    path('', include('search.urls')),
    path('home/',
Example #22
0
from django.contrib import admin
from django.urls import path, include
from django.contrib.auth import views
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="E-DUKA APIs",
        default_version='v1',
        description="APIs for the E-DUKA project",
        terms_of_service="https://eduka/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="TEST License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('dukaapp.urls')),
    path('tinymce/', include('tinymce.urls')),
    path('api-token-auth/', obtain_auth_token),
    path('swagger/',
         schema_view.with_ui('swagger', cache_timeout=0),
         name='schema-swagger-ui'),
    path('redoc/',
         schema_view.with_ui('redoc', cache_timeout=0),
Example #23
0
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include

from rest_framework import permissions

from drf_yasg import openapi
from drf_yasg.views import get_schema_view

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

urlpatterns = [
    path('admin/', admin.site.urls),
    path('swagger/', schema_view.with_ui('swagger', cache_timeout=0)),
    path('v1/products/', include('product.urls')),
    path('v1/account/', include('account.urls')),
    path('v1/orders/', include('order.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #24
0
# + templates(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \

if settings.DEBUG:
    # from rest_framework import permissions
    from drf_yasg.views import get_schema_view
    from drf_yasg import openapi

    schema_view = get_schema_view(
        openapi.Info(
            title=settings.CONFIG.get('swagger', 'title'),
            default_version=settings.CONFIG.get('swagger', 'default_version'),
            description=settings.CONFIG.get('swagger', 'description'),
            # terms_of_service="https://www.google.com/policies/terms/",
            contact=openapi.Contact(
                email=settings.CONFIG.get('swagger', 'contact')),
            license=openapi.License(
                name=settings.CONFIG.get('swagger', 'license')),
        ),
        public=True,
        # permission_classes=(permissions.IsAuthenticated,),
    )

    urlpatterns += [
        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'),
    ]
    # redoc 页面有bug,缺 position: fixed 等前端bug,暂时没有找到项目PR
Example #25
0
from django.conf import settings

# from source.apps.api.swagger_schema import SwaggerSchemaView
from source.apps.api.patches.routers import DefaultRouter
from source.apps.api.common.urls import router as common_router
from source.apps.api.auth.urls import router as auth_router


schema_view = get_schema_view(
    openapi.Info(
        title=getattr(settings, 'APP_NAME') + ' API',
        default_version='v1',
        description="Test description",
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email=getattr(settings, 'ADMIN_EMAILS', '*****@*****.**')),
        license=openapi.License(name="Trade secret"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,)
)

router = DefaultRouter()
router.extend(auth_router)
router.extend(common_router)

urlpatterns = [
    re_path(r'', include(router.urls)),
    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'),
    re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
    # re_path(r'^docs/', SwaggerSchemaView.as_view()),
Example #26
0
from django.conf.urls import url, include
from rest_framework import routers
from backend.views import *
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="ImexHS - AI Core API",
        default_version='v1',
        description=
        "This is the official documentation and technical manual to use the AI Core API from ImexHS",
        terms_of_service="https://www.imexhs.com/aicore/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="Only for internal use"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

router = routers.DefaultRouter()
router.register(r'user', UserViewSet)
router.register(r'image', ImageViewSet)
router.register(r'model', ModelViewSet)
router.register(r'request', ModelRequestViewSet)
router.register(r'response', ModelResponseViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^', include(router.urls)),
Example #27
0
from django.conf.urls import include
from django.urls import path, re_path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view

from nautobot.core.api.views import APIRootView, StatusView, GraphQLDRFAPIView
from nautobot.extras.plugins.urls import plugin_api_patterns


openapi_info = openapi.Info(
    title="Nautobot API",
    default_version="v2",
    description="API to access Nautobot",
    terms_of_service="https://github.com/nautobot/nautobot",
    license=openapi.License(name="Apache v2 License"),
)

schema_view = get_schema_view(
    openapi_info,
    validators=["flex", "ssv"],
    public=True,
)


urlpatterns = [
    # Base views
    path("", APIRootView.as_view(), name="api-root"),
    path("circuits/", include("nautobot.circuits.api.urls")),
    path("dcim/", include("nautobot.dcim.api.urls")),
    path("extras/", include("nautobot.extras.api.urls")),
    path("ipam/", include("nautobot.ipam.api.urls")),
router.register(r"tags", blog.views.TagViewSet, basename="tag")
router.register(r"comments", comments.views.CommentViewSet, basename="comment")
router.register(r"search", blog.views.PostSearchView, basename="search")
# 仅用于 API 版本管理测试
router.register(r"api-version",
                blog.views.ApiVersionTestViewSet,
                basename="api-version")

schema_view = get_schema_view(
    openapi.Info(
        title="HelloDjango REST framework tutorial API",
        default_version="v1",
        description="HelloDjango REST framework tutorial AP",
        terms_of_service="",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="GPLv3 License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny, ),
)

urlpatterns = [
    path("admin/", admin.site.urls),
    path("search/", include("haystack.urls")),
    path("", include("blog.urls")),
    path("", include("comments.urls")),
    # 记得在顶部引入 AllPostsRssFeed
    path("all/rss/", AllPostsRssFeed(), name="rss"),
    path("api/v1/", include((router.urls, "api"), namespace="v1")),
    path("api/v2/", include((router.urls, "api"), namespace="v2")),
    path("api/auth/", include("rest_framework.urls",
Example #29
0
from django.conf.urls import url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include, path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions

schema_view = get_schema_view(
    openapi.Info(
        title='Tiberium API',
        default_version='v1',
        description='CTF Tiberium 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.AllowAny, ),
)

urlpatterns = [
    path(f'api/{settings.ADMIN_URL}/', admin.site.urls),
    path('api/v1/', include('apps.user.urls')),
    path('api/v1/', include('apps.post.urls')),
    path('api/v1/', include('apps.passport.urls')),
    path('api/v1/', include('apps.youtube.urls')),
]

urlpatterns += staticfiles_urlpatterns()
Example #30
0
File: yasg.py Project: jbm2593/test
from django.urls import path, include
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from drf_yasg import openapi

schema_url_v1_patterns = [
    path('boards', include('wisestudy_app.urls'))
]

schema_view = get_schema_view(
    openapi.Info(
        title="WiseStudy Open API",
        default_version='v1',
        description=
        """
        WiseStudy Open API 문서 페이지

        스터디 앱을 만들라고합니다

        팀원:SCH
        """,
        terms_of_service="https://www.google.com/policies/terms/",
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="WiseStudy"),
    ),
    validators=['flex'],
    public=True,
    permission_classes=(permissions.AllowAny,),
    # patterns=schema_url_v1_patterns,
)