summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitea <gitea@fake.local>2021-08-14 20:08:49 -0400
committerGitea <gitea@fake.local>2021-08-14 20:08:49 -0400
commit02207b80082fc2273dcad2e9372c87fa0707e890 (patch)
tree41397c78eb2b09933c33910b16369ebc333a5cc7
parent344767d63038c54587a74a18e5a4be0759511875 (diff)
fixed upload path
-rw-r--r--app/books/models.py4
-rw-r--r--config/django.ini8
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