Пример #1
0
                examples=images_report_create_201_example,
                schema=ReportImageSerializer
            )
        },
        request_body=report_image_request,
        code_examples=[
            {
                'lang': 'Bash',
                'source': report_image_bash
            }
        ]
    )(ReportImageView.as_view())

versioned_paths = [
    path('', schema_view.with_ui('redoc', cache_timeout=None), name='root'),
    path('auth_tokens/register', Register.as_view(), name='register'),
    path('rate_limit', CheckRates.as_view(), name='key_info'),
    path('auth_tokens/verify/<str:code>',
         VerifyEmail.as_view(),
         name='verify-email'),
    re_path(r'auth_tokens/',
            include('oauth2_provider.urls', namespace='oauth2_provider')),
    path('images/<str:identifier>', ImageDetail.as_view(),
         name='image-detail'),
    path('images/<str:identifier>/report',
         decorated_report_image_view,
         name='report-image'),
    path('recommendations/images/<str:identifier>',
         RelatedImage.as_view(),
         name='related-images'),
    re_path('images', SearchImages.as_view(), name='images'),
Пример #2
0
        description=description,
        contact=openapi.Contact(email="*****@*****.**"),
        license=openapi.License(name="MIT License", url=license_url),
        terms_of_service=tos_url,
        x_logo={
            "url": logo_url,
            "backgroundColor": "#FFFFFF"
        }),
    public=True,
    permission_classes=(rest_framework.permissions.AllowAny, ),
)

urlpatterns = [
    path('', schema_view.with_ui('redoc', cache_timeout=None), name='root'),
    path('admin/', admin.site.urls),
    path('oauth2/register', Register.as_view(), name='register'),
    path('oauth2/key_info', CheckRates.as_view(), name='key_info'),
    path('oauth2/verify/<str:code>',
         VerifyEmail.as_view(),
         name='verify-email'),
    re_path(r'^oauth2/',
            include('oauth2_provider.urls', namespace='oauth2_provider')),
    # path('list', CreateList.as_view()),
    # path('list/<str:slug>', ListDetail.as_view(), name='list-detail'),
    re_path('image/search', SearchImages.as_view()),
    path('image/browse/<str:provider>', BrowseImages.as_view()),
    path('image/<str:identifier>', ImageDetail.as_view(), name='image-detail'),
    path('image/related/<str:identifier>',
         RelatedImage.as_view(),
         name='related-images'),
    path('statistics/image', ImageStats.as_view(), name='about-image'),