From ce3148ac8933a33020a38e3a6d2bf7ed32d3acdf Mon Sep 17 00:00:00 2001 From: Stewart Adam Date: Sun, 30 Aug 2020 16:37:00 -0700 Subject: [PATCH] Permit MEDIA_URL and STATIC_URL to be set from environment variables (#143) --- recipes/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/settings.py b/recipes/settings.py index e08b8c0e..1bd29594 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -175,10 +175,10 @@ LANGUAGES = [ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.0/howto/static-files/ -STATIC_URL = '/static/' +STATIC_URL = os.getenv('STATIC_URL', '/static/') STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") -MEDIA_URL = '/media/' +MEDIA_URL = os.getenv('MEDIA_URL', '/media/') MEDIA_ROOT = os.path.join(BASE_DIR, "mediafiles") # Serve static files with gzip