From 02207b80082fc2273dcad2e9372c87fa0707e890 Mon Sep 17 00:00:00 2001 From: Gitea Date: Sat, 14 Aug 2021 20:08:49 -0400 Subject: fixed upload path --- app/books/models.py | 4 ++-- config/django.ini | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/books/models.py b/app/books/models.py index c8eb041..417e587 100644 --- a/app/books/models.py +++ b/app/books/models.py @@ -17,7 +17,7 @@ from utils.util import markdown_to_html def get_upload_path(self, filename): - return "images/book-covers/%s" % (filename) + return "%s/%s" % (settings.IMAGES_ROOT, filename) class Book(Orderable): @@ -74,7 +74,7 @@ class Book(Orderable): @receiver(post_save, sender=Book) def post_save_events(sender, update_fields, created, instance, **kwargs): if instance.image: - base_path = "%s/%s/" % (settings.MEDIA_ROOT, "/".join(str(i) for i in instance.image.name.split('/')[:-1])) + base_path = "%s/%s/" % (settings.IMAGES_ROOT, "/".join(str(i) for i in instance.image.name.split('/')[:-1])) filename, file_extension = os.path.splitext(instance.image.path) img = Image.open(instance.image.path) resize_image(img, None, 160, 78, base_path, "%s_tn%s" % (filename.split('/')[-1], file_extension)) diff --git a/config/django.ini b/config/django.ini index f238c17..4bd0589 100644 --- a/config/django.ini +++ b/config/django.ini @@ -9,17 +9,17 @@ enable-threads = true uid = http gid = http -socket = /tmp/uwsgi.sock +socket = /tmp/uwsgiwandren.sock chmod-socket = 664 chown-socket = www-data:www-data # the base directory -chdir = /home/lxf/sites/luxagraf.net +chdir = /home/lxf/sites/wandrenbooks.net # django's wsgi file module = config.wsgi # the virtualenv -home = /home/lxf/sites/luxagraf.net/venv +home = /home/lxf/sites/wandrenbooks.net/venv buffer-size =65535 #plugin=python @@ -27,4 +27,4 @@ limit-as = 1024 limit-post = 0 # clear environment on exit vacuum = true -logto = /var/log/uwsgi/test.log +logto = /var/log/uwsgi/wandren.log -- cgit v1.2.3-70-g09d2