mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-06 07:30:40 +00:00
Fix profile image upload
Media file upload, such as video files or profile images, were uploaded to /edx/var/edxapp/media because the MEDIA_ROOT setting is defined in common.py. Close #54.
This commit is contained in:
parent
75fa18267f
commit
75d7ee688b
@ -15,3 +15,8 @@ import os
|
||||
for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
|
||||
if not os.path.exists(folder):
|
||||
os.makedirs(folder)
|
||||
|
||||
# Fix media files paths
|
||||
VIDEO_IMAGE_SETTINGS['STORAGE_KWARGS']['location'] = MEDIA_ROOT
|
||||
VIDEO_TRANSCRIPTS_SETTINGS['STORAGE_KWARGS']['location'] = MEDIA_ROOT
|
||||
PROFILE_IMAGE_BACKEND['options']['location'] = os.path.join(MEDIA_ROOT, 'profile-images/')
|
||||
|
@ -1,8 +1,9 @@
|
||||
import os
|
||||
from ..aws import *
|
||||
|
||||
# Load module store settings from config files
|
||||
update_module_store_settings(MODULESTORE, doc_store_settings=DOC_STORE_CONFIG)
|
||||
|
||||
# Set uploaded media file path
|
||||
MEDIA_ROOT = "/openedx/data/uploads/"
|
||||
|
||||
# Change syslog-based loggers which don't work inside docker containers
|
||||
@ -10,10 +11,16 @@ LOGGING['handlers']['local'] = LOGGING['handlers']['console'].copy()
|
||||
LOGGING['handlers']['tracking'] = LOGGING['handlers']['console'].copy()
|
||||
|
||||
# Create folders if necessary
|
||||
import os
|
||||
for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
|
||||
if not os.path.exists(folder):
|
||||
os.makedirs(folder)
|
||||
|
||||
# Fix media files paths
|
||||
VIDEO_IMAGE_SETTINGS['STORAGE_KWARGS']['location'] = MEDIA_ROOT
|
||||
VIDEO_TRANSCRIPTS_SETTINGS['STORAGE_KWARGS']['location'] = MEDIA_ROOT
|
||||
PROFILE_IMAGE_BACKEND['options']['location'] = os.path.join(MEDIA_ROOT, 'profile-images/')
|
||||
|
||||
ALLOWED_HOSTS = [
|
||||
ENV_TOKENS.get('LMS_BASE'),
|
||||
FEATURES['PREVIEW_LMS_BASE'],
|
||||
|
Loading…
Reference in New Issue
Block a user