I wanted to set a custom media folder for uploads as some files under media/ are commited to repo, and I wanted the media folder to be a symbolic link to a mounted remote file system, so as not to keep uploads directly on the QATrack+ server.
Once I created my symbolic link mymedia, first thing I tried was to set in local_settings.py:
import os PROJECT_ROOT = os.path.abspath(os.path.dirname(file)) MEDIA_ROOT = os.path.join(PROJECT_ROOT, "mymedia")
However, I could not access existing uploads (NOT FOUND error). I found that, on top of the previous modification, I needed to set MEDIA_URL in local_settings.py to the same value:
MEDIA_URL = '/mymedia/'
Is this expected? I would have expected these two settings to be independent, i.e. that the URL to access uploads did not depend on the name of the media folder.