I have set up Django 1.3 onto my BlueHost account with Python 2.6 and it is working well except when I enter the admin area it is void of any css/formatting – all I get is text. In my research I found that I need to set up the web server to 'serve' the static files, Django does not do this (except when using the Django development server).
I have made several attempts but no success… Here are the current settings:
Settings.py:
ADMIN_MEDIA_PREFIX = '/static/admin/'
.htaccess:
AddHandler fcgid-script .fcgi
RewriteEngine On
Rewritebase /
RewriteRule ^(static/admin/.*)$ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /django/test1/mysite.fcgi/$1 [QSA,L]
There is also a symlink at the projects static files ../static/admin/ to ../django/contrib/admin/media
You can see the resulting page at http://www.foreignlanguageflashcards.com/django/test1/admin/
Thanks.
Best Answer
With some help from http://blog.ruedaminute.com/2011/01/2011-installation-instructions-for-django-on-bluehost/ I was able to get it working. I gave up on using symlinks and:
/.local/lib/python2.6/site-packages/django/contrib/admin/media
tohttp://www.foo.com/django/project/static/admin/media/
(part of my problem earlier was confusing the django project directory with the public url directory)ADMIN_MEDIA_PREFIX = '/django/project/static/admin/media/'