Beispiel #1
0
from rest_framework.routers import DefaultRouter

from documents.views import (
    FetchView, PushView, SenderViewSet, TagViewSet, DocumentViewSet)

router = DefaultRouter()
router.register(r'senders', SenderViewSet)
router.register(r'tags', TagViewSet)
router.register(r'documents', DocumentViewSet)

urlpatterns = [

    # API
    url(
        r"^api/auth/",
        include('rest_framework.urls', namespace="rest_framework")
    ),
    url(r"^api/", include(router.urls, namespace="drf")),

    # File downloads
    url(r"^fetch/(?P<pk>\d+)$", FetchView.as_view(), name="fetch"),

    # The Django admin
    url(r"", admin.site.urls),

] + static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.UPLOAD_SHARED_SECRET:
    urlpatterns.insert(0, url(r"^push$", PushView.as_view(), name="push"))
Beispiel #2
0
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:
    urlpatterns.insert(0, url(r"^push$", PushView.as_view(), name="push"))

# 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'
Beispiel #3
0
router.register(r"logs", LogViewSet)
router.register(r"reminders", ReminderViewSet)
router.register(r"tags", TagViewSet)

urlpatterns = [

    # API
    url(r"^api/auth/",
        include('rest_framework.urls', namespace="rest_framework")),
    url(r"^api/", include(router.urls, namespace="drf")),

    # File downloads
    url(r"^fetch/(?P<kind>doc|thumb)/(?P<pk>\d+)$",
        FetchView.as_view(),
        name="fetch"),

    # File uploads
    url(r"^push$", csrf_exempt(PushView.as_view()), name="push"),

    # 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)

# 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'