Пример #1
0
    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'),
    path('sources', ImageStats.as_view(), name='about-image'),
    path('link', CreateShortenedLink.as_view(), name='make-link'),
    path('link/<str:path>', ResolveShortenedLink.as_view(), name='resolve'),
    path('thumbs/<str:identifier>', ProxiedImage.as_view(), name='thumbs'),
    path('oembed', OembedView.as_view(), name='oembed')
]
if WATERMARK_ENABLED:
    versioned_paths.append(
        path('watermark/<str:identifier>', Watermark.as_view()))

urlpatterns = [
    path('', RedirectView.as_view(url='/v1')),
    path('admin/', admin.site.urls),
    re_path('healthcheck', HealthCheck.as_view()),
    re_path(r'^swagger(?P<format>\.json|\.yaml)$',
            schema_view.without_ui(cache_timeout=None),
            name='schema-json'),
    re_path(r'^swagger/$',
            schema_view.with_ui('swagger', cache_timeout=15),
            name='schema-swagger-ui'),
    re_path(r'^redoc/$',
            schema_view.with_ui('redoc', cache_timeout=15),
            name='schema-redoc'),
    path('v1/', include(versioned_paths))
Пример #2
0
    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'),
    path('link', CreateShortenedLink.as_view(), name='make-link'),
    path('link/<str:path>', ResolveShortenedLink.as_view(), name='resolve'),
    re_path('healthcheck', HealthCheck.as_view()),
    re_path(r'^swagger(?P<format>\.json|\.yaml)$',
            schema_view.without_ui(cache_timeout=None),
            name='schema-json'),
    re_path(r'^swagger/$',
            schema_view.with_ui('swagger', cache_timeout=15),
            name='schema-swagger-ui'),
    re_path(r'^redoc/$',
            schema_view.with_ui('redoc', cache_timeout=15),
            name='schema-redoc')
]

if WATERMARK_ENABLED:
    urlpatterns.append(path('watermark/<str:identifier>', Watermark.as_view()))