I have a Django app running on a server and I would like to continue working on it locally with the runserver
command. My problem concern the use of common static and media files. The media folder content changing frequently in production I have to download those media files from the server each time I want to dev locally and add those to the MEDIA_ROOT
path on my computer.
The database is common to both dev and production environment since it is a MySQL host on my server.
How can I tell Django in local mode to lookup static and media files on a remote url from my domain name instead of localhost?
Like https://example.com/media/
instead of :
https://127.0.0.1:8000/media/
EDIT : module django-storages
After some time I finally find a module which seems aligned with what I'm looking for, django-storages with its 'FTP' functionnality' however the documentation is really weak and I can't find any tutorial explaining what I want to achieve.
DEFAULT_FILE_STORAGE = 'storages.backends.ftp.FTPStorage'
FTP_STORAGE_LOCATION = 'ftp://user:password@host:21/media'
What kind of configuration should I add to my settings file to get MEDIA_ROOT looking for this location when I'm working locally ?