Preparing for a proper UI

This commit is contained in:
Daniel Quinn 2016-03-03 18:09:10 +00:00
parent 66d4407565
commit b8be20b565
3 changed files with 29 additions and 3 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en-gb">
<head>
<title>Paperless</title>
<meta charset="utf-8">
</head>
<body>
</body>
</html>

View File

@ -2,7 +2,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse
from django.template.defaultfilters import slugify
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import FormView, DetailView
from django.views.generic import FormView, DetailView, TemplateView
from rest_framework.mixins import (
RetrieveModelMixin, UpdateModelMixin, DestroyModelMixin, ListModelMixin)
@ -19,6 +19,17 @@ from .serialisers import (
SenderSerializer, TagSerializer, DocumentSerializer, LogSerializer)
class IndexView(TemplateView):
template_name = "documents/index.html"
def get_context_data(self, **kwargs):
print(kwargs)
print(self.request.GET)
print(self.request.POST)
return TemplateView.get_context_data(self, **kwargs)
class FetchView(LoginRequiredMixin, DetailView):
model = Document

View File

@ -21,7 +21,8 @@ from django.contrib import admin
from rest_framework.routers import DefaultRouter
from documents.views import (
FetchView, PushView, SenderViewSet, TagViewSet, DocumentViewSet, LogViewSet
IndexView, FetchView, PushView,
SenderViewSet, TagViewSet, DocumentViewSet, LogViewSet
)
router = DefaultRouter()
@ -39,11 +40,15 @@ urlpatterns = [
),
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<pk>\d+)$", FetchView.as_view(), name="fetch"),
# The Django admin
url(r"", admin.site.urls),
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)