From 7f838433edde6a03d1b7f71da269f9756a3f91e9 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 28 Nov 2022 21:26:02 -0700 Subject: Allow local:// media backends Fixes #77 --- takahe/settings.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'takahe') diff --git a/takahe/settings.py b/takahe/settings.py index 3e2ffcd..ae07ecd 100644 --- a/takahe/settings.py +++ b/takahe/settings.py @@ -310,6 +310,11 @@ if SETUP.MEDIA_BACKEND: if parsed.hostname is not None: port = parsed.port or 443 AWS_S3_ENDPOINT_URL = f"https://{parsed.hostname}:{port}" + elif parsed.scheme == "local": + if not (MEDIA_ROOT and MEDIA_URL): + raise ValueError( + "You must provide MEDIA_ROOT and MEDIA_URL for a local media backend" + ) else: raise ValueError(f"Unsupported media backend {parsed.scheme}") -- cgit v1.2.3