from django.conf import settings def get_upload_path(instance, filename): return instance.upload_path or settings.GALLERY_UPLOAD_PATH