diff --git a/admin_tools/dashboard/templates/admin/index.html b/admin_tools/dashboard/templates/admin/index.html
index 688a2d0..9687f6a 100644
--- a/admin_tools/dashboard/templates/admin/index.html
+++ b/admin_tools/dashboard/templates/admin/index.html
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
-{% load i18n admin_tools_dashboard_tags %}
+{% load i18n admin_static admin_tools_dashboard_tags %}
{% block extrastyle %}
{{ block.super }}
diff --git a/admin_tools/dashboard/templates/admin_tools/dashboard/css.html b/admin_tools/dashboard/templates/admin_tools/dashboard/css.html
index 8bbd313..4a5d038 100644
--- a/admin_tools/dashboard/templates/admin_tools/dashboard/css.html
+++ b/admin_tools/dashboard/templates/admin_tools/dashboard/css.html
@@ -1,7 +1,8 @@
-
-
+{% load staticfiles %}
+
+
-{% for css in css_files %}
-{% endfor %}
+{% for media_type, files in css_files.items %}{% for css in files %}
+{% endfor %}{% endfor %}
diff --git a/admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.html b/admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.html
index 88831ae..0bacdc2 100644
--- a/admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.html
+++ b/admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.html
@@ -1,38 +1,38 @@
-{% load i18n admin_tools_dashboard_tags %}
+{% load i18n staticfiles admin_tools_dashboard_tags %}
{% block dashboard_scripts %}
-
+
+
+
+
{% block extrahead %}{% endblock %}
{% block blockbots %}{% endblock %}
@@ -28,27 +27,19 @@
{% if user.is_active and user.is_staff %}
{% endif %}
@@ -66,8 +57,8 @@
{% block messages %}
{% if messages %}
{% for message in messages %}
- - {{ message }}
- {% endfor %}
+ {{ message|capfirst }}
+ {% endfor %}
{% endif %}
{% endblock messages %}
diff --git a/admin_tools/theming/templatetags/theming_tags.py b/admin_tools/theming/templatetags/theming_tags.py
index 17f7730..d21c49d 100644
--- a/admin_tools/theming/templatetags/theming_tags.py
+++ b/admin_tools/theming/templatetags/theming_tags.py
@@ -6,7 +6,7 @@ To load the theming tags just do: ``{% load theming_tags %}``.
from django import template
from django.conf import settings
-from admin_tools.utils import get_media_url
+from django.contrib.staticfiles.storage import staticfiles_storage
register = template.Library()
@@ -15,11 +15,9 @@ def render_theming_css():
Template tag that renders the needed css files for the theming app.
"""
css = getattr(settings, 'ADMIN_TOOLS_THEMING_CSS', False)
- if css:
- css = '/'.join([get_media_url(), css])
- else:
- css = '/'.join([get_media_url(), 'admin_tools', 'css', 'theming.css'])
- return '' % css
+ if not css:
+ css = '/'.join(['admin_tools', 'css', 'theming.css'])
+ return '' % staticfiles_storage.url(css)
register.simple_tag(render_theming_css)
diff --git a/admin_tools/utils.py b/admin_tools/utils.py
index 676b4ea..8ff0412 100644
--- a/admin_tools/utils.py
+++ b/admin_tools/utils.py
@@ -154,14 +154,3 @@ class AppListElementMixin(object):
return reverse('%s:%s_%s_add' % (get_admin_site_name(context),
app_label,
model.__name__.lower()))
-
-def get_media_url():
- """
- Returns the django admin tools media URL.
- """
- media_url = getattr(settings, 'ADMIN_TOOLS_MEDIA_URL', None)
- if media_url is None:
- media_url = getattr(settings, 'STATIC_URL', None)
- if media_url is None:
- media_url = getattr(settings, 'MEDIA_URL')
- return media_url.rstrip('/')