import logging import os from django.contrib import messages from django.shortcuts import redirect, render from django.http import HttpRequest from django.core.files.storage import default_storage from django.core.files.base import ContentFile from ..models import ImageMemo from django.contrib.auth.decorators import login_required logger = logging.getLogger(__name__) from .thumbnail import document_thumbnail from .register import register from .upload import upload_document from .delete import delete_document def index(request): # return HttpResponse("Hello, world. You're at the polls index.") return render(request, "index.html") __all__ = [ "index", "document_thumbnail", "register", "dashboard", "settings", "view_document", "download_document", "upload_document", "delete_document", ] @login_required def dashboard(request: HttpRequest): documents = ImageMemo.objects.filter(author__id=request.user.id).order_by( "-updated_at" ) context = {"documents": documents} return render(request, "dashboard.html", context) @login_required def settings(request): return render(request, "settings.html") @login_required def view_document(request): return render(request, "document.html") @login_required def download_document(request): return render(request, "document.html")