diff options
author | Andrew Godwin | 2022-11-28 21:26:02 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-28 21:26:02 -0700 |
commit | 7f838433edde6a03d1b7f71da269f9756a3f91e9 (patch) | |
tree | 75c67edefe593b64734d81a5d5d3c0f448b395fa | |
parent | a3bc7ff196e09a1e995b47f53b05717282f0ba72 (diff) | |
download | takahe-7f838433edde6a03d1b7f71da269f9756a3f91e9.tar.gz takahe-7f838433edde6a03d1b7f71da269f9756a3f91e9.tar.bz2 takahe-7f838433edde6a03d1b7f71da269f9756a3f91e9.zip |
Allow local:// media backends
Fixes #77
-rw-r--r-- | takahe/settings.py | 5 |
1 files changed, 5 insertions, 0 deletions
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}") |