mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Use Django's own static template tag in the admin.
This commit is contained in:
parent
9e08cef4e0
commit
7a6e0602d3
3 changed files with 1 additions and 21 deletions
|
|
@ -1,5 +1,5 @@
|
|||
{% extends "admin/base_site.html" %}
|
||||
{% load constance_tags admin_list i18n %}
|
||||
{% load admin_static admin_list i18n %}
|
||||
|
||||
|
||||
{% block extrastyle %}
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
from __future__ import absolute_import
|
||||
from django import template
|
||||
from django.conf import settings
|
||||
from django.core.files.storage import get_storage_class
|
||||
|
||||
try:
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
except ImportError:
|
||||
staticfiles_storage = get_storage_class(settings.STATICFILES_STORAGE)()
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def static(path):
|
||||
"""
|
||||
A template tag that returns the URL to a file
|
||||
using staticfiles' storage backend
|
||||
"""
|
||||
return staticfiles_storage.url(path)
|
||||
Loading…
Reference in a new issue