2014-01-05 00:39:38 by jdixon
If you're using Graphite with Django 1.4 or newer, you've probably noticed the broken styling on the Admin module. This appears to be an annoyance at worst, but it's ugly nonetheless. I don't have a fix for this yet, but I have a workaround for anyone using Apache with their Graphite web UI.
This is what the view typically looks like when you visit /admin/ on your Graphite server.
Due to changes introduced in Django 1.4, the media (static content) files for the django.contrib.admin module where moved to a different directory. Graphite hasn't been updated to reflect these changes, so stylesheets like /admin/css/base.css aren't being loaded at all, resulting in something like this instead:
Fortunately, there's an easy workaround with Apache. Add the following directives to your relevant configuration block (I use a VirtualHost) and then restart your web service.
RedirectMatch ^/admin(.*)admin/([^/]+)/([^/]+)$ /media/$2/$3 Alias /media/ "/usr/share/pyshared/django/contrib/admin/static/admin/"