3 from django.conf import settings
6 def get_image_folders():
7 return [fn for fn in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR)) if not fn.startswith('.')]
10 def get_images_from_folder(folder):
11 return [settings.MEDIA_URL + settings.IMAGE_DIR + '/' + folder + '/' + fn for fn
12 in os.listdir(os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, folder))
13 if not fn.startswith('.')]