alesdotio / django-admin-shortcuts

Add simple and pretty shortcuts to the django admin homepage.
Other
205 stars 53 forks source link

Django 1.3: 'admin_static' is not a valid tag library #29

Closed marcosguedes closed 6 years ago

marcosguedes commented 6 years ago

I don't know if this should be considered a bug due to the sheer age of Django 1.3 but since this package supports Django 1.2 upwards I think it should be mentioned that there are some bugs in the templates and how to solve them for people who come across them.

admin/index.html

{% load i18n admin_static admin_shortcuts_tags %}

must be changed to

{% load i18n adminmedia admin_shortcuts_tags %}

------- // -------

<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />

must be changed to

<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/dashboard.css" />

admin_shortcuts/style.css

{% for class in classes %}.admin_shortcuts .shortcuts li a.{{ class }} { background-image: url('{% static "admin_shortcuts" %}/{{ class }}.png'); }{% endfor %}

must be changed to

{% for class in classes %}.admin_shortcuts .shortcuts li a.{{ class }} { background-image: url('{% get_static_prefix %}admin_shortcuts/{{ class }}.png'); }{% endfor %}

Other than that it seems to work fine. Thank you for an awesome package 👍

alesdotio commented 6 years ago

I didn't really have time to test with Django 1.3, but I just released 2.0.0, which simplified a lot of the templates (and doesn't use admin_static).