I have recently uploaded my app on EC2 server running Ubuntu, Python 2.7.3, django.VERSION 1.5.1. I have managed to successfully launch it without any CSS/Images or JS. I can view templates and navigate them means template directory settings are working. Looks like I am missing some setting for static/media files. Can anyone please advise?
Content of "cat /etc/apache2/httpd.conf"
WSGIScriptAlias / /home/ubuntu/site/ProjectName/ProjectName/wsgi.py
WSGIPythonPath /home/ubuntu/site/ProjectName
<Directory /home/ubuntu/site/ProjectName/ProjectName>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
Content of settings.py
MEDIA_ROOT = '/var/www/media/'
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/var/www/static/admin/'
STATICFILES_DIRS = (
'/var/www/static',
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_DIRS = ('/var/www/templates',)
**$ ls -ltr /var/www**
total 16
-rw-r--r-- 1 root root 177 Jul 26 20:21 index.html
drwxr-xr-x 3 www-data root 4096 Jul 28 04:20 static
drwxr-xr-x 5 www-data root 4096 Jul 28 04:20 media
drwxr-xr-x 20 www-data root 4096 Jul 28 16:29 templates
Errors in apache2/access.log
[29/Jul/2013:13:41:36 -0500] "GET /static/neatadmin/css/bootstrap.css HTTP/1.1" 404 1798 [29/Jul/2013:13:41:36 -0500] "GET /static/neatadmin/css/jquery.fancybox.css HTTP/1.1" 404 1806 [29/Jul/2013:13:41:36 -0500] "GET /static/neatadmin/js/jquery.js HTTP/1.1" 404 1798 [29/Jul/2013:13:41:36 -0500] "GET /static/neatadmin/js/jquery.metadata.js HTTP/1.1" 404 1804 [29/Jul/2013:13:41:36 -0500] "GET /static/neatadmin/css/login.css HTTP/1.1" 404 1794 [29/Jul/2013:13:41:36 -0500] "GET /static/neatadmin/js/error.js HTTP/1.1" 404 1794
Errors in apache2/error.log (I dont think it's relevant but just FYI)
[Mon Jul 29 13:41:29 2013] [error] /usr/local/lib/python2.7/dist-packages/django/conf/init.py:221: DeprecationWarning: You have no filters defined on the 'mail_admins' logging handler: adding implicit debug-false-only filter. See http://docs.djangoproject.com/en/dev/releases/1.4/#request-exceptions-are-now-always-logged [Mon Jul 29 13:41:29 2013] [error] DeprecationWarning) [Mon Jul 29 13:41:29 2013] [error] [Mon Jul 29 13:41:35 2013] [error] /usr/local/lib/python2.7/dist-packages/django/conf/init.py:221: DeprecationWarning: You have no filters defined on the 'mail_admins' logging handler: adding implicit debug-false-only filter. See http://docs.djangoproject.com/en/dev/releases/1.4/#request-exceptions-are-now-always-logged [Mon Jul 29 13:41:35 2013] [error] DeprecationWarning) [Mon Jul 29 13:41:35 2013] [error]