From 620ca7a35fe42d7a1585c273ad463e0feacdf58b Mon Sep 17 00:00:00 2001 From: zuber Date: Tue, 18 Aug 2009 23:02:43 +0200 Subject: [PATCH] IMAGE_DIR jest teraz relatywny do MEDIA_ROOT. --- apps/explorer/models.py | 6 +++--- project/settings.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/explorer/models.py b/apps/explorer/models.py index 3b5848b7..5fa93ad6 100644 --- a/apps/explorer/models.py +++ b/apps/explorer/models.py @@ -4,11 +4,11 @@ from django.conf import settings def get_image_folders(): - return [fn for fn in os.listdir(settings.IMAGE_DIR) if not fn.startswith('.')] + return [fn for fn in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR)) if not fn.startswith('.')] def get_images_from_folder(folder): - return ['/media/images/' + folder + '/' + fn for fn - in os.listdir(os.path.join(settings.IMAGE_DIR, folder)) + return [settings.MEDIA_URL + settings.IMAGE_DIR + '/' + folder + '/' + fn for fn + in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, folder)) if not fn.startswith('.')] diff --git a/project/settings.py b/project/settings.py index aad5a882..5632527f 100644 --- a/project/settings.py +++ b/project/settings.py @@ -105,7 +105,7 @@ INSTALLED_APPS = ( ) REPOSITORY_PATH = '/Users/zuber/Projekty/platforma/files/books' -IMAGE_DIR = '/Users/zuber/Projekty/platforma/files/images' +IMAGE_DIR = 'images' try: from localsettings import * -- 2.20.1