2020-10-26 00:35:24 +01:00
|
|
|
from django.conf.urls import include, url
|
2015-12-20 19:23:33 +00:00
|
|
|
from django.contrib import admin
|
2020-10-25 23:03:02 +01:00
|
|
|
from rest_framework.authtoken import views
|
2016-02-16 09:28:34 +00:00
|
|
|
from rest_framework.routers import DefaultRouter
|
|
|
|
|
|
2018-12-30 12:20:08 +00:00
|
|
|
from paperless.views import FaviconView
|
2016-02-16 09:28:34 +00:00
|
|
|
from documents.views import (
|
2018-01-06 18:51:10 +00:00
|
|
|
CorrespondentViewSet,
|
|
|
|
|
DocumentViewSet,
|
|
|
|
|
LogViewSet,
|
2018-09-05 15:25:14 +02:00
|
|
|
TagViewSet,
|
2020-10-25 23:03:02 +01:00
|
|
|
DocumentTypeViewSet,
|
|
|
|
|
SearchView,
|
2020-10-27 17:07:13 +01:00
|
|
|
IndexView,
|
|
|
|
|
SearchAutoCompleteView
|
2018-09-25 16:09:33 +02:00
|
|
|
)
|
2016-02-16 09:28:34 +00:00
|
|
|
|
2020-10-25 23:03:02 +01:00
|
|
|
api_router = DefaultRouter()
|
|
|
|
|
api_router.register(r"correspondents", CorrespondentViewSet)
|
|
|
|
|
api_router.register(r"document_types", DocumentTypeViewSet)
|
|
|
|
|
api_router.register(r"documents", DocumentViewSet)
|
|
|
|
|
api_router.register(r"logs", LogViewSet)
|
|
|
|
|
api_router.register(r"tags", TagViewSet)
|
|
|
|
|
|
2016-01-01 16:13:59 +00:00
|
|
|
|
2015-12-20 19:23:33 +00:00
|
|
|
urlpatterns = [
|
2016-02-21 00:14:50 +00:00
|
|
|
|
|
|
|
|
# API
|
2020-10-25 23:03:02 +01:00
|
|
|
url(r"^api/auth/",include(('rest_framework.urls', 'rest_framework'), namespace="rest_framework")),
|
2020-10-27 17:07:13 +01:00
|
|
|
url(r"^api/search/autocomplete/", SearchAutoCompleteView.as_view(), name="autocomplete"),
|
2020-10-25 23:03:02 +01:00
|
|
|
url(r"^api/search/", SearchView.as_view(), name="search"),
|
|
|
|
|
url(r"^api/token/", views.obtain_auth_token), url(r"^api/", include((api_router.urls, 'drf'), namespace="drf")),
|
2017-06-18 21:54:36 +01:00
|
|
|
|
2018-12-30 12:20:08 +00:00
|
|
|
# Favicon
|
|
|
|
|
url(r"^favicon.ico$", FaviconView.as_view(), name="favicon"),
|
|
|
|
|
|
2016-02-21 00:14:50 +00:00
|
|
|
# The Django admin
|
2016-03-03 18:18:38 +00:00
|
|
|
url(r"admin/", admin.site.urls),
|
2018-01-06 18:51:16 +00:00
|
|
|
|
2020-10-25 23:03:02 +01:00
|
|
|
# Root of the Frontent
|
|
|
|
|
url(r".*", IndexView.as_view()),
|
2016-02-21 00:14:50 +00:00
|
|
|
|
2020-10-26 00:35:24 +01:00
|
|
|
]
|
2016-02-08 23:46:16 +00:00
|
|
|
|
2017-05-25 20:16:59 +10:00
|
|
|
# Text in each page's <h1> (and above login form).
|
|
|
|
|
admin.site.site_header = 'Paperless'
|
|
|
|
|
# Text at the end of each page's <title>.
|
|
|
|
|
admin.site.site_title = 'Paperless'
|
|
|
|
|
# Text at the top of the admin index page.
|
|
|
|
|
admin.site.index_title = 'Paperless administration'
|