python - Apache and sharing media in a separate directory -
i building django app runs out of /users/me/dropbox directory.
localhost pointed @ /users/me/sites directory.
mod_wsgi installed. apache installed django installed , app working fine in development mode
i trying embed media in template media comes directory outside of django app - in root of machine - /proyectos
the permissions directories , preceding directories readable _www
i think understand that
- mod_wsgi serve dynamic files
- apache serve static files css , template files, media files referencing in /proyectos directory
i have following in settings.py:
staticfiles_dirs = (os.path.join(base, "static"), ) static_url = "/static/" media_url = "/proyectos/" wsgi_application = 'mbrain.wsgi.application'
in /etc/apache2/extra/vhosts/localhost.conf have:
<virtualhost *:80> documentroot "/users/me/sites/localhost" servername localhost wsgidaemonprocess localhost python-path=/users/me/dropbox/mbrain_adam/mbrain/:/users/me/dropbox/mbrain_adam/mbrain/venv/include/python2.7 wsgiprocessgroup localhost alias /proyectos/ /proyectos/ <directory /proyectos> require granted </directory> wsgiscriptalias / /users/me/dropbox/mbrain_adam/mbrain/mbrain/wsgi.py <directory /users/me/dropbox/mbrain_adam/mbrain/mbrain> <files wsgi.py> require granted </files> </directory>
so embed media file in template have url: {{ media_url }}{{ asset.assetpath }}
when load page in browser console shows expanded path media asset 404 error - http/1.1" 404 3045.
i’d appreciate feedback on whether approaching right way or if have missed concept. on 404 error appreciated.
cheers!
adam
does work when remove trailing slash? alias /proyectos /proyectos
Comments
Post a Comment