fixed book download, linux path is case sensitive

This commit is contained in:
TinyAtoms 2020-08-01 20:07:09 -03:00
parent ed03ea4a1c
commit 6a2f89d36e
4 changed files with 15 additions and 1 deletions

4
.gitignore vendored
View File

@ -4,6 +4,10 @@ db.sqlite3
dummyusers.json dummyusers.json
*.prof *.prof
# IDE
.vscode
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]

Binary file not shown.

View File

@ -149,7 +149,7 @@ class BookDetailView(generic.DetailView):
pass pass
context["imgpath"] = context["object"].path + "/cover.jpg" context["imgpath"] = context["object"].path + "/cover.jpg"
download = Data.objects.get(book=context["object"].id) download = Data.objects.get(book=context["object"].id)
context["download"] = f"{context['object'].path}/{download.name}.{download.format}" context["download"] = f"{context['object'].path}/{download.name}.{download.format.lower()}"
return context return context

View File

@ -0,0 +1,10 @@
{
"CALIBRE_DIR": "PATH\\TO\\your\\calibre\library",
"SECRET_KEY": "u(8^+rb%rz5hsx4v^^y(ul7g(4n7a8!db@s*9(m5cs*2_ppy8+",
"ALLOWED_HOSTS": [
"127.0.0.1"
],
"INTERNAL_IPS": [
"127.0.0.1"
]
}