feat: app inside project with custom command

This commit is contained in:
eneller
2025-03-16 15:31:45 +01:00
parent 52998fa280
commit 0589148b6f
14 changed files with 73 additions and 21 deletions

21
src/core/views.py Normal file
View File

@@ -0,0 +1,21 @@
from django.shortcuts import render
from django.http import HttpRequest, HttpResponse
from epub2go.convert import get_all_books, Book
def index(request: HttpRequest):
title = 'epub2go'
targetParam = request.GET.get('t', None)
books = get_all_books()
if targetParam is not None:
getEpub(targetParam)
return render(request, 'index.html', locals())
def getEpub(param):
print(param)
# TODO validate / sanitize input
# TODO check for existing file and age
# TODO download
# TODO redirect to loading page
# TODO redirect to download page
raise NotImplementedError