|
What are the recommended settings for user-uploaded media? It seems like media (avatars, etc) should be served by the static app, but at least in my dev setup, MEDIA_ROOT/URL are distinct from STATIC_ROOT/URL. Locally, my media settings are:
but when I try these settings on webfaction and I upload avatar pics, it looks like links are pointing somewhere valid and the files are uploaded to the server, but the images are showing broken link icons. |
This depends on the Django version - it sounds like your local application might be a different from the Django application version installed on WebFaction, and Django's
settings.pyfiles and static media configuration has changed considerably in recent versions.Our documentation covers standard static media service for Django 1.4. For uploads, you should only need to add a single
symbolic link to static-onlyapplication withextra_infopointing to the directory where your uploads are located, and then ensuring that the URL path where this new application is mounted is correct such that the URLs which your application is using route through the symbolic link application and are served via the front-end Nginx server.If you'd like us to take a look at your setup, feel free to open a support ticket. We can then update this question with the correct answer once the issue has been solved completely.
I fixed this by setting:
MEDIA_ROOT = STATIC_ROOT
MEDIA_URL = STATIC_URL
Thanks Ryan.