Hello,
I am trying to deploy a new Django website where I am trying to point to many css, js, image, pdf files, etc. Everything works well in the development setup.
Basically, I am using a mod-wsgi setup in Apache, and Django version 1.5 on Ubuntu linux 12.10. The application is served with the template and page content visible. It is clear, however, that my application cannot "see" the css, js, and images that support the pages.
I am trying to emulate a previous website that is successfully served, but am having these problems.
My setup is as follows:
Application location examples:
/home/eps_admin/epsWeb/epsWeb/settings.py
/home/eps_admin/epsWeb/epsWeb/urls.py
/home/eps_admin/epsWeb/epsWeb/site-media/images #all images
/home/eps_admin/epsWeb/epsWeb/site-media/css #css files
/home/eps_admin/epsWeb/epsWeb/site-media/js #js files
...etc....
In my Django pages... I try to load files with hard coded links like this...
/site-media/images/image.png
/site-media/css/styles.css
/site/media/js/javascript.js
My httpd.conf:WSGIScriptAlias / /home/eps_admin/epsWeb/epsWeb/wsgi.py
WSGIPythonPath /home/eps_admin/epsWeb/
<VirtualHost
129.24.36.34:80>
Alias /site-media/ /home/eps_admin/epsWeb/epsWeb/site-media/
Alias /images/ /home/eps_admin/epsWeb/epsWeb/site-media/images/
AliasMatch ^/([^/]*\.css) /home/eps_admin/epsWeb/epsWeb/site-media/css/
ServerName
epswww1.unm.edu ServerAlias
epswww1.unm.edu ServerAdmin
epswww1.unm.edu ErrorLog ${APACHE_LOG_DIR}/epswww1_errors.log
DocumentRoot /home/eps_admin/epsWeb/
<Directory /home/eps_admin/epsWeb/epsWeb>
<Files wsgi.py>
Order allow,deny
# Order deny,allow
# Require all granted
Allow from all
</Files>
</Directory>
</VirtualHost>
Relevant settings in settings.pyPROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
MEDIA_ROOT = os.path.join(PROJECT_PATH, "media")
MEDIA_URL = "/media/"
STATIC_ROOT = os.path.join(PROJECT_PATH, "static")
STATIC_URL = '/static/'
This setup has worked well on another site I have running in production, but doesn't seem to work here. I would appreciate any help on what I am doing wrong.
Thanks much, Wilbur