Permit MEDIA_URL and STATIC_URL to be set from environment variables (#143)

This commit is contained in:
Stewart Adam 2020-08-30 16:37:00 -07:00
parent bc39b53aad
commit ce3148ac89

View File

@ -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