RedirectView.as_view(url='/api/documents/%(pk)s/preview/'), ), ])), re_path( r"^push$", csrf_exempt( RedirectView.as_view(url='/api/documents/post_document/'))), # Frontend assets TODO: this is pretty bad, but it works. path('assets/<path:path>', RedirectView.as_view(url='/static/frontend/en-US/assets/%(path)s')), # TODO: with localization, this is even worse! :/ # login, logout path('accounts/', include('django.contrib.auth.urls')), # Root of the Frontent re_path(r".*", login_required(IndexView.as_view())), ] websocket_urlpatterns = [ re_path(r'ws/status/$', StatusConsumer.as_asgi()), ] # Text in each page's <h1> (and above login form). admin.site.site_header = 'Paperless-ng' # Text at the end of each page's <title>. admin.site.site_title = 'Paperless-ng' # Text at the top of the admin index page. admin.site.index_title = _('Paperless-ng administration')
r"^thumb/(?P<pk>\d+)$", RedirectView.as_view(url='/paperless/api/documents/%(pk)s/thumb/'), ), re_path( r"^preview/(?P<pk>\d+)$", RedirectView.as_view(url='/paperless/api/documents/%(pk)s/preview/'), ), ])), re_path(r"^paperless/push$", csrf_exempt( RedirectView.as_view(url='/paperless/api/documents/post_document/'))), # Frontend assets TODO: this is pretty bad, but it works. path('paperless/assets/<path:path>', RedirectView.as_view(url='/paperless/static/frontend/en-US/assets/%(path)s')), # TODO: with localization, this is even worse! :/ # login, logout path('paperless/accounts/', include('django.contrib.auth.urls')), # Root of the Frontent re_path(r"paperless/.*", login_required(IndexView.as_view())), ] # Text in each page's <h1> (and above login form). admin.site.site_header = 'Paperless-ng' # Text at the end of each page's <title>. admin.site.site_title = 'Paperless-ng' # Text at the top of the admin index page. admin.site.index_title = _('Paperless-ng administration')
router.register(r'correspondents', CorrespondentViewSet) router.register(r'tags', TagViewSet) router.register(r'documents', DocumentViewSet) router.register(r'logs', LogViewSet) urlpatterns = [ # API url( r"^api/auth/", include('rest_framework.urls', namespace="rest_framework") ), url(r"^api/", include(router.urls, namespace="drf")), # Normal pages (coming soon) url(r"^$", IndexView.as_view(), name="index"), # File downloads url( r"^fetch/(?P<kind>doc|thumb)/(?P<pk>\d+)$", FetchView.as_view(), name="fetch" ), # The Django admin url(r"admin/", admin.site.urls), url(r"", admin.site.urls), # This is going away ] + static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.SHARED_SECRET:
re_path( r"^push$", csrf_exempt( RedirectView.as_view(url=settings.BASE_URL + 'api/documents/post_document/'))), # Frontend assets TODO: this is pretty bad, but it works. path( 'assets/<path:path>', RedirectView.as_view(url=settings.STATIC_URL + 'frontend/en-US/assets/%(path)s')), # TODO: with localization, this is even worse! :/ # login, logout path('accounts/', include('django.contrib.auth.urls')), # Root of the Frontent re_path(r".*", login_required(IndexView.as_view()), name='base'), ] websocket_urlpatterns = [ re_path(r'ws/status/$', StatusConsumer.as_asgi()), ] # Text in each page's <h1> (and above login form). admin.site.site_header = 'Paperless-ng' # Text at the end of each page's <title>. admin.site.site_title = 'Paperless-ng' # Text at the top of the admin index page. admin.site.index_title = _('Paperless-ng administration')