mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-07 16:04:02 +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]:
|
for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
|
||||||
if not os.path.exists(folder):
|
if not os.path.exists(folder):
|
||||||
os.makedirs(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 *
|
from ..aws import *
|
||||||
|
|
||||||
|
# Load module store settings from config files
|
||||||
update_module_store_settings(MODULESTORE, doc_store_settings=DOC_STORE_CONFIG)
|
update_module_store_settings(MODULESTORE, doc_store_settings=DOC_STORE_CONFIG)
|
||||||
|
|
||||||
|
# Set uploaded media file path
|
||||||
MEDIA_ROOT = "/openedx/data/uploads/"
|
MEDIA_ROOT = "/openedx/data/uploads/"
|
||||||
|
|
||||||
# Change syslog-based loggers which don't work inside docker containers
|
# 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()
|
LOGGING['handlers']['tracking'] = LOGGING['handlers']['console'].copy()
|
||||||
|
|
||||||
# Create folders if necessary
|
# Create folders if necessary
|
||||||
|
import os
|
||||||
for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
|
for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
|
||||||
if not os.path.exists(folder):
|
if not os.path.exists(folder):
|
||||||
os.makedirs(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 = [
|
ALLOWED_HOSTS = [
|
||||||
ENV_TOKENS.get('LMS_BASE'),
|
ENV_TOKENS.get('LMS_BASE'),
|
||||||
FEATURES['PREVIEW_LMS_BASE'],
|
FEATURES['PREVIEW_LMS_BASE'],
|
||||||
|
Loading…
Reference in New Issue
Block a user