R.B.
R.B.

Reputation: 255

No Style/css On Django Admin

I'm a complete newbie to apache, so the the whole deployment process has been a pain in the backside, so bear with me.

I'm having the problem of my admin site using the css formatting, it's just coming up as plain html.

I know there are other questions that answer this issue here and elsewhere, but for the life of me I can't figure out to get it working. So if anyone can spot what I'm messing up I'd be eternally grateful.

The relevant lines in settings.py are:

STATIC_ROOT = '/var/www/logparseradmin/logparser/static'

STATIC_URL = 'http://theyard/logparseradmin/static/'

ADMIN_MEDIA_PREFIX = '/var/www/Django-1.3.1/django/contrib/admin/media/'

and I have:

Alias /static/ /var/www/Django-1.3.1/django/contrib/admin/media/

in my httpd.conf.

I've tried a whole bunch of variations on this, as the various answers on the Internet have suggested, but no luck.

Thanks very much.

Upvotes: 2

Views: 1847

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599610

There's at least three things wrong here.

Firstly, your STATIC_URL is not probably a valid URL - http://theyard/ is not a real domain name, and won't work unless you've got local DNS resolution (which, given your self-described newbie status, seems unlikely.)

Secondly, the path value of STATIC_URL doesn't match the Alias you've put in httpd.conf - STATIC_URL has /logparseradmin/static/, whereas Alias just has /static/

Thirdly, ADMIN_MEDIA_PREFIX should be a URL path, not a file path.

And without seeing the rest of your http.conf it's impossible to be sure, but there may be fourth issue with mod_wsgi matching the URL before your Alias is processed.

Upvotes: 1

Related Questions